PHPackages                             cyrkulewski/personal-id-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. cyrkulewski/personal-id-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

cyrkulewski/personal-id-validator
=================================

Library to validate personal IDs of different countries.

25.4kPHP

Since Apr 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/martyshka/pidv)[ Packagist](https://packagist.org/packages/cyrkulewski/personal-id-validator)[ RSS](/packages/cyrkulewski-personal-id-validator/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Personal ID Validator
=====================

[](#personal-id-validator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/79dc441b910a066846c5b3d0944da5d0ccbb6eaf4eae1a57c0a36e15d1f02878/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6379726b756c6577736b692f706572736f6e616c2d69642d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cyrkulewski/personal-id-validator)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/66f9055d6b3336ed7100c8a2fb4f9fc746907428536d7d515e0700127baa8e60/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6379726b756c6577736b692f706572736f6e616c2d69642d76616c696461746f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/cyrkulewski/personal-id-validator)[![Coverage Status](https://camo.githubusercontent.com/967680a74c54501e1b796a753bfac45e2885ed42d1387878dbee562cbec6bd74/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6379726b756c6577736b692f706572736f6e616c2d69642d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/cyrkulewski/personal-id-validator/code-structure)[![Quality Score](https://camo.githubusercontent.com/2a8c41549bd5552b269432ad06ef98bf53309eb58296543c099b39e9fbae86d7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6379726b756c6577736b692f706572736f6e616c2d69642d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/cyrkulewski/personal-id-validator)[![Total Downloads](https://camo.githubusercontent.com/ff631c0a19958fada81ea5e96fdb29a577b45c24cd0079be6173cebcf593d08a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6379726b756c6577736b692f706572736f6e616c2d69642d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cyrkulewski/personal-id-validator)

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](https://en.wikipedia.org/wiki/ISO_3166-1) standard) to the validator.

Supported countries (in alphabetical order):

Country codeCountry namePersonal ID nameDEGermanySteueridentifikationsnummerDKDenmarkCPR-nummerFIFinlandHETUFRFranceNuméro de sécurité sociale (INSEE)PLPolandPESELSESwedenPersonnumerInstall
-------

[](#install)

Via Composer

```
$ composer require cyrkulewski/personal-id-validator
```

Usage
-----

[](#usage)

There is one public function used for validation. It will return boolean. One need to pass ID to check and country code.

```
$validator->validate('ID', 'COUNTRY');
```

```
use cyrkulewski\PIdV\Dictionary\CountryDictionary;
use cyrkulewski\PIdV\PIdValidator;

$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
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Aleksander Cyrkulewski](https://github.com/martyshka)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2bb43dd864de14e9371387efda351ff36b6fc40a9ccaccf7a935cf7274ef36d3?d=identicon)[martyshka](/maintainers/martyshka)

---

Top Contributors

[![martyshka](https://avatars.githubusercontent.com/u/1006739?v=4)](https://github.com/martyshka "martyshka (13 commits)")

### Embed Badge

![Health badge](/badges/cyrkulewski-personal-id-validator/health.svg)

```
[![Health](https://phpackages.com/badges/cyrkulewski-personal-id-validator/health.svg)](https://phpackages.com/packages/cyrkulewski-personal-id-validator)
```

###  Alternatives

[chaoswey/taiwan-id-validator

台灣身分證、統一編號驗證

319.9k](/packages/chaoswey-taiwan-id-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
