PHPackages                             vladdesv/php-nin - 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. vladdesv/php-nin

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

vladdesv/php-nin
================

Verify structure of individual national identification numbers

1.0.0(6y ago)1219[2 issues](https://github.com/vladdeSV/php-nin/issues)MITPHPPHP ^7.2CI failing

Since May 1Pushed 6y ago2 watchersCompare

[ Source](https://github.com/vladdeSV/php-nin)[ Packagist](https://packagist.org/packages/vladdesv/php-nin)[ RSS](/packages/vladdesv-php-nin/feed)WikiDiscussions develop Synced 6d ago

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

[![logo](https://github.com/vladdeSV/php-nin/raw/develop/resources/logo-transparent.png)](https://github.com/vladdeSV/php-nin/raw/develop/resources/logo-transparent.png)

National Identification Numbers
===============================

[](#national-identification-numbers)

[![php version](https://camo.githubusercontent.com/527cd0fec60fadccd33ee892a5bc84dccd84ee5146cbdbb1f8f12ae372be8b53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f766c6164646573762f7068702d6e696e2f6465762d72656c656173653f636f6c6f723d383839324246266c6f676f3d706870)](https://github.com/vladdeSV/php-nin/blob/develop/composer.json)[![latest release](https://camo.githubusercontent.com/a1e8679d5070e193c6d03d12a846c91c0f815db9e7314c43086087acff4585a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766c6164646553562f7068702d6e696e2e7376673f7374796c653d666c6174)](https://packagist.org/packages/vladdeSV/php-nin)[![codecov](https://camo.githubusercontent.com/7ed8c15106ca6d8a78a36eacce6e78d3b8a4858f83d37b671223046e2bff33a9/68747470733a2f2f636f6465636f762e696f2f67682f766c6164646553562f7068702d6e696e2f6272616e63682f72656c656173652f67726170682f62616467652e737667)](https://codecov.io/gh/vladdeSV/php-nin)[![styleci](https://camo.githubusercontent.com/3318a32e756c599c9daca9752232a06225dafbc136e26579b2c83f1abbdcb6a6/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3234373330343939362f736869656c643f7374796c653d666c6174266272616e63683d72656c65617365)](https://github.styleci.io/repos/247304996)

This library validates the structure of individual identification numbers. Currently supporting all Nordic countries.

Supported countries
-------------------

[](#supported-countries)

- Sweden
    - Personal identification numbers
    - Coordination numbers
- Norway
    - Birth numbers
    - D-numbers
    - H-numbers
- Finland
    - Personal identity code
- Iceland
    - Identification number
- Denmark
    - Personal identification number

Usage
-----

[](#usage)

```
use NIN\NationalIdentificationNumberParser;

$nin = NationalIdentificationNumberParser::tryParse('890629-1870', 'SE');
echo $nin;                   // '890629-1870'
echo $nin->getCountryCode(); // 'SE'
```

Installation
------------

[](#installation)

```
composer require vladdesv/php-nin

```

License
-------

[](#license)

MIT © [Vladimirs Nordholm](https://github.com/vladdeSV)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2207d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44827edfae6903e65e14ebeb05d279f516ea6b9a884a8ca557c88200ceb86bc6?d=identicon)[vladdeSV](/maintainers/vladdeSV)

---

Top Contributors

[![vladdeSV](https://avatars.githubusercontent.com/u/7542961?v=4)](https://github.com/vladdeSV "vladdeSV (94 commits)")

---

Tags

identification-numberphpvalidator

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vladdesv-php-nin/health.svg)

```
[![Health](https://phpackages.com/badges/vladdesv-php-nin/health.svg)](https://phpackages.com/packages/vladdesv-php-nin)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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