The National Id Extraction library helps to validate and extract data from national id like:
- Birth Date
- Governorate
- Gender
the validation is based on egyption national id segmentation that discribed in this link.
The main class is NationalIdExtractor
that can be instantiate as the following:
- using the prameterless constractor, in this case it will use the default INationalIdResourceProvider implementation.
- providing a custom
INationalIdResourceProvider
implementation.
Then you can call Extract method and passing to it the national Id number you want to extract and validate.
this interface should be implemented if you want to customize the validation message (change language as an example) and the governorate or you have this resources in a different provider like (database or json file..etc).
there is NationalIdResourcesDefaultProvider
which is the default implementation that i have create it as an example and to be ready to use.
NationalIdExtractorPresentation is a console project to demonstrate how we can use this library using two scenarios :
- using the default
INationalIdResourceProvider
implementation. - using custom
INationalIdResourceProvider
implementation which isNationalIdResourcesArabicProvider
that have an arabic impelementation and you can do your own implementation to target a different sources with different langages.
If you have any suggestions to improve my code and techniques, please let me know. Your feedback would be highly appreciated.