https://github.com/raigu/personal-code-validation
Validation of Estonian person identification code according to the standard "EVS 585:2007 Personal code. Structure"
https://github.com/raigu/personal-code-validation
code estonia estonian personal php private validation
Last synced: 15 days ago
JSON representation
Validation of Estonian person identification code according to the standard "EVS 585:2007 Personal code. Structure"
- Host: GitHub
- URL: https://github.com/raigu/personal-code-validation
- Owner: raigu
- License: mit
- Created: 2019-09-29T09:22:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-11T21:04:26.000Z (about 2 years ago)
- Last Synced: 2025-09-20T14:39:33.845Z (4 months ago)
- Topics: code, estonia, estonian, personal, php, private, validation
- Language: PHP
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://packagist.org/packages/raigu/personal-code-validation)
[](LICENSE.md)
[](https://packagist.org/packages/raigu/personal-code-validation)
[](https://github.com/raigu/personal-code-validation/actions?query=workflow%3Abuild)
# Estonian person identification code validation
Validation of Estonian personal identification code according to the
standard [EVS 585:2007 Personal code. Structure](https://www.evs.ee/products/evs-585-2007).
# Compatibility
PHP 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3
# Motivation
I needed a validation that states it fallows the official standard. I bought the standard from Estonian Centre for Standardisation and worked it through.
I needed a package with long time support. It has no other dependencies and is tested against all supported PHP versions in [GitHub Action](https://github.com/raigu/personal-code-validation/actions).
# Install
````bash
$ composer require raigu/personal-code-validation
````
# Usage
Validation of personal code:
```php
require_once 'vendor/autoload.php';
if (\Raigu\is_valid_personal_code('00000000000')) {
echo "Valid\n";
} else {
echo "Invalid\n";
}
```
Calculation of personal code's control number:
```php
echo \Raigu\personal_code_control_number('1234567890') . "\n";
echo \Raigu\personal_code_control_number('12345678901') . "\n";
```
will output:
```text
2
2
```
# Testing
```bash
$ composer test
```
# License
Licensed under [MIT](LICENSE.md)