PHPackages                             iiifx-production/ukraine-identification-number - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. iiifx-production/ukraine-identification-number

ActiveExtension[Utility &amp; Helpers](/categories/utility)

iiifx-production/ukraine-identification-number
==============================================

Ukraine Identification Number

v1.0.3(4y ago)117.3k4MITPHPPHP ^5.5||^7.0||^8.0

Since Nov 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/iiifx-production/ukraine-identification-number)[ Packagist](https://packagist.org/packages/iiifx-production/ukraine-identification-number)[ Docs](https://github.com/iiifx-production/ukraine-identification-number)[ RSS](/packages/iiifx-production-ukraine-identification-number/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (8)Used By (0)

Identification Number: Ukraine
==============================

[](#identification-number-ukraine)

Идентификационный номер налогоплательщика Украины. Парсер и генератор ИНН.

Алгоритм
--------

[](#алгоритм)

Номер ИНН состоит из десяти знаков

```
$number = "{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}"

```

Вычисляем контрольную сумму: суммируем множители первых 9 знаков ИНН

```
$sum =
    ( $number{0} * -1 ) +
    ( $number{1} * 5 ) +
    ( $number{2} * 7 ) +
    ( $number{3} * 9 ) +
    ( $number{4} * 4 ) +
    ( $number{5} * 6 ) +
    ( $number{6} * 10 ) +
    ( $number{7} * 5 ) +
    ( $number{8} * 7 )

```

Получаем контрольное число: делим контрольную сумму на 11 по модулю, потом на 10

```
$digit = ( $sum % 11 ) % 10

```

Если контрольное число и 10 знак в ИНН совпадает - номер правильный

```
$digit === $number{9}

```

Пол определяется по 9 знаку в ИНН: четное - женщина, нечетное - мужчина

```
$sex = ( $number{8} % 2 ) ? MALE : FEMALE

```

Возраст определяется по первым 5 знакам ИНН: это количество дней от 1899-12-31

Установка
---------

[](#установка)

Используя Composer:

```
$ composer require iiifx-production/ukraine-identification-number
```

Использование
-------------

[](#использование)

Парсер ИНН:

```
use iiifx\Identification\Ukraine\Parser;

# Номер ИНН
$number = '2245134075';

# Создаем парсер
$parser = Parser::create($number);
# Или так
$parser = new Parser($number);

# Проверяем правильность ИНН
if ($parser->isValidNumber()) {
    echo $parser->getNumber(); # 2245134075

    # Определяем пол владельца ИНН
    echo $parser->getPersonSex(); # Parser::SEX_MALE
    echo $parser->isPersonMale(); # true
    echo $parser->isPersonFemale(); # false

    # Определяем возраст и дату рождения
    echo $parser->getPersonAge(); # 55
    echo $parser->getPersonBirth('Y-m-d'); # 1961-06-20
    echo $parser->getPersonBirthDatetime()->format('d.m.Y H:i:s'); # 20.06.1961 00:00:00

    # Контрольная сумма и число
    echo $parser->getControlSum(); # 192
    echo $parser->getControlDigit(); # 5
}
```

Генератор ИНН:

```
use iiifx\Identification\Ukraine\Builder;

# Создаем генератор
$builder = new Builder();
# Или вот так
$builder = Builder::create(Builder::SEX_MALE, new DateTime('2010-05-12'));

# Указывам пол
$builder->setPersonSex(Builder::SEX_MALE);
$builder->setPersonMale();
$builder->setPersonFemale();

# Указываем возраст
$builder->setPersonAge(55);
$builder->setPersonBirthDatetime(new DateTime('1962-11-03'));

# Генерируем ИНН
echo $builder->createNumber(); # 2295209520
```

Тесты
-----

[](#тесты)

Удалены, нужно перенастраивать

Лицензия
--------

[](#лицензия)

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 73.3% 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 ~361 days

Recently: every ~451 days

Total

6

Last Release

1649d ago

Major Versions

v0.1.1 → v1.0.02016-12-04

PHP version history (2 changes)v0.1.0PHP &gt;=5.4

v1.0.3PHP ^5.5||^7.0||^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c38df6d1bb48765cd3e07f39c58e0d384e0e3d9a9fd69068ab3149bc2fa1c5fc?d=identicon)[IIIFX](/maintainers/IIIFX)

---

Top Contributors

[![iiifx](https://avatars.githubusercontent.com/u/3157964?v=4)](https://github.com/iiifx "iiifx (11 commits)")[![mikk150](https://avatars.githubusercontent.com/u/4953629?v=4)](https://github.com/mikk150 "mikk150 (2 commits)")[![bondikone](https://avatars.githubusercontent.com/u/12188138?v=4)](https://github.com/bondikone "bondikone (1 commits)")[![rinu](https://avatars.githubusercontent.com/u/469009?v=4)](https://github.com/rinu "rinu (1 commits)")

---

Tags

iiifxinnphpukrainevatnumberidentificationINNukraine

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/iiifx-production-ukraine-identification-number/health.svg)

```
[![Health](https://phpackages.com/badges/iiifx-production-ukraine-identification-number/health.svg)](https://phpackages.com/packages/iiifx-production-ukraine-identification-number)
```

###  Alternatives

[mpociot/vat-calculator

EU VAT calculation, the way it should be.

1.3k3.9M18](/packages/mpociot-vat-calculator)[kwn/number-to-words

Multi language standalone PHP number to words converter. Fully tested, open for extensions and new languages.

4235.0M21](/packages/kwn-number-to-words)[commerceguys/tax

Tax library with a flexible data model, predefined tax rates, powerful resolving logic.

286763.3k](/packages/commerceguys-tax)[php-decimal/php-decimal

Correctly-rounded arbitrary precision decimal floating point

781.0M9](/packages/php-decimal-php-decimal)[tivie/php-os-detector

A small utility library that detects the OS the server is running on

201.6M11](/packages/tivie-php-os-detector)[hekmatinasser/notowo

This Package helps developers change number to word for all language on Laravel freamwork PHP

32510.4k2](/packages/hekmatinasser-notowo)

PHPackages © 2026

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