Download the PHP package ngarak-dev/nida-parse without Composer
On this page you can find all versions of the php package ngarak-dev/nida-parse. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ngarak-dev/nida-parse
More information about ngarak-dev/nida-parse
Files in ngarak-dev/nida-parse
Package nida-parse
Short Description A Laravel package that attempts to reverse engineer how NIDA (National Identification Authority) numbers are generated and extract basic information from National Identification Numbers (NIN) without using the official NIDA API.
License MIT
Informations about the package nida-parse
NIDA Parse
A Laravel package that attempts to reverse engineer how NIDA (National Identification Authority) numbers are generated and extract basic information from National Identification Numbers (NIN) without using the official NIDA API.
This is a fork of the Python implementation: reverse_nida
โ ๏ธ Disclaimer
This project is for educational and research purposes only. It attempts to understand the structure and patterns in NIDA numbers through reverse engineering. The accuracy of extracted information is not guaranteed, and this should not be used for official verification purposes.
๐ Installation
Requirements
- PHP >= 8.2
- Composer
- Laravel 11.x or 12.x
Install via Composer
Publish Configuration and Assets
Publish the configuration file:
Publish the CSV location files to storage:
Or publish both at once:
๐ Usage
Using the Helper Function
Using the Service Classes Directly
Using Dependency Injection
๐ง Configuration
After publishing the configuration file, you can customize the package behavior in config/nida-parse.php:
How Location Lookup Works
The package uses a smart lookup strategy:
- Combined File (Preferred): If
tanzania_locations_combined.csvexists instorage/app/(after publishing), it will be used first for faster lookups. - Individual Files (Fallback): If the combined file is not found or doesn't contain the ward code, the package falls back to individual region CSV files (11.csv, 21.csv, etc.).
The combined file is automatically published when you run:
You can also override the CSV directory or combined file path when instantiating LocationLookup:
๐ NIN Format
The package supports two NIN formats:
-
Dashed format:
YYYYMMDD-LLLLL-SSSSS-XX- Example:
19990504-35710-00001-28
- Example:
- Compact format:
YYYYMMDDWWWWWSSSSSXX- Example:
19990504357100000128
- Example:
Where:
YYYYMMDD: Birth date (Year, Month, Day)LLLLL: Ward code (5 digits)SSSSS: Sequence number (5 digits)XX: Unknown/check digits (2 digits, first digit indicates gender)
๐ Package Structure
๐งช Testing
๐ License
MIT
๐ Credits
- Original Python implementation by Henrylee
- Laravel package conversion by Ngara Wambura