PHPackages                             rickard2/luhnar - 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. rickard2/luhnar

ActiveLibrary

rickard2/luhnar
===============

Validate social security numbers

2.0.0(11y ago)314.7k—6.3%21MITPHP

Since Aug 5Pushed 11y ago2 watchersCompare

[ Source](https://github.com/rickard2/luhnar)[ Packagist](https://packagist.org/packages/rickard2/luhnar)[ RSS](/packages/rickard2-luhnar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (1)

Luhnar
======

[](#luhnar)

Validate personnumer (social security numbers)

Name inspired by the Luhn algorithm used to validate swedish personnummer.

Usage:

```
$validator = new Rickard2\Luhnar\Validator();

$validator->validate('9909193766', 'se'); // true
$validator->validate('9909193776', 'se'); // false

```

The swedish validator will accept input in the following formats:

- YYMMDD-NNGC
- YYMMDD-NNGC
- YYMMDD+NNGC
- YYYYMMDDNNGC
- YYYYMMDD-NNGC
- YYYYMMDD+NNGC

Source: [http://en.wikipedia.org/wiki/National\_identification\_number#Sweden](http://en.wikipedia.org/wiki/National_identification_number#Sweden)

The finnish validator will accept input in the following formats:

- DDMMYYCZZZQ

Source: [http://en.wikipedia.org/wiki/National\_identification\_number#Finland](http://en.wikipedia.org/wiki/National_identification_number#Finland)

JavaScript Equivalent:

Symfony2 validator:

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 87% 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

Every ~133 days

Total

5

Last Release

4137d ago

Major Versions

1.0.3 → 2.0.02015-01-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/730f4dbc98c89530020578f7c2416def4ec2d92a758d61cedf60c2ab439167ea?d=identicon)[rickard2](/maintainers/rickard2)

---

Top Contributors

[![rickard2](https://avatars.githubusercontent.com/u/488425?v=4)](https://github.com/rickard2 "rickard2 (20 commits)")[![hyperized](https://avatars.githubusercontent.com/u/827954?v=4)](https://github.com/hyperized "hyperized (2 commits)")[![lakebranch](https://avatars.githubusercontent.com/u/1404888?v=4)](https://github.com/lakebranch "lakebranch (1 commits)")

### Embed Badge

![Health badge](/badges/rickard2-luhnar/health.svg)

```
[![Health](https://phpackages.com/badges/rickard2-luhnar/health.svg)](https://phpackages.com/packages/rickard2-luhnar)
```

PHPackages © 2026

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