dev-master
9999999-dev https://github.com/martyshka/pidvLibrary to validate personal IDs of different countries.
MIT
The Requires
- php ~5.5|~7.0
The Development Requires
aleksander cyrkulewski personal id validator
Library to validate personal IDs of different countries.
![Software License][ico-license]
![Coverage Status][ico-scrutinizer]
![Total Downloads][ico-downloads], (*1)
Library to validate personal IDs of different countries. Most of the countries in the world assign certain ID to each citizen. This library helps to validate it. One just need to pass ID and country short-name (in ISO 3166-1 alpha-2 standard) to the validator., (*2)
Supported countries (in alphabetical order):, (*3)
Country code | Country name | Personal ID name |
---|---|---|
DE | Germany | Steueridentifikationsnummer |
DK | Denmark | CPR-nummer |
FI | Finland | HETU |
FR | France | Numéro de sécurité sociale (INSEE) |
PL | Poland | PESEL |
SE | Sweden | Personnumer |
Via Composer, (*4)
``` bash $ composer require cyrkulewski/personal-id-validator, (*5)
## Usage There is one public function used for validation. It will return boolean. One need to pass ID to check and country code. ``` php $validator->validate('ID', 'COUNTRY');
``` php use cyrkulewski\PIdV\Dictionary\CountryDictionary; use cyrkulewski\PIdV\PIdValidator;, (*6)
$validator = new PIdValidator(); $validator->validate('197704190011', CountryDictionary::SWEDEN); // true $validator->validate('311280-888Y', CountryDictionary::FINLAND); // true $validator->validate('abcdef', CountryDictionary::DENMARK); // false $validator->validate('197704190011', 'NON-SUPPORTED-COUNTRY'); // false, (*7)
## Change log Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. ## Testing ``` bash $ composer test
Please see CONTRIBUTING and CONDUCT for details., (*8)
If you discover any security related issues, please email cyrkulewski@gmail.com instead of using the issue tracker., (*9)
The MIT License (MIT). Please see License File for more information., (*10)
Library to validate personal IDs of different countries.
MIT
aleksander cyrkulewski personal id validator