19/01
2015
Wallogit.com
2017 © Pedro Peláez
Validate social security numbers
Validate personnumer (social security numbers), (*1)
Name inspired by the Luhn algorithm used to validate swedish personnummer., (*2)
Usage:, (*3)
$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:, (*4)
Source: http://en.wikipedia.org/wiki/National_identification_number#Sweden, (*5)
The finnish validator will accept input in the following formats:, (*6)
Source: http://en.wikipedia.org/wiki/National_identification_number#Finland, (*7)
JavaScript Equivalent: https://github.com/rickard2/luhnarjs, (*8)
Symfony2 validator: https://github.com/rickard2/luhnar-validator, (*9)