PHPackages                             ybelenko/ogrn - 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. ybelenko/ogrn

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

ybelenko/ogrn
=============

Tiny library for validating OGRN and OGRNIP business identifiers in Russia.

v2.0.0(4y ago)06MITPHPPHP ^7.0 || ^8.0

Since May 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ybelenko/ogrn)[ Packagist](https://packagist.org/packages/ybelenko/ogrn)[ Docs](https://github.com/ybelenko/ogrn)[ RSS](/packages/ybelenko-ogrn/feed)WikiDiscussions master Synced 3d ago

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

OGRN
====

[](#ogrn)

[![Latest Stable Version](https://camo.githubusercontent.com/e76db47e3d03bc3273d0a0f871a58fa27f3b5817c66da5942a8d2af293ab8cc5/68747470733a2f2f706f7365722e707567782e6f72672f7962656c656e6b6f2f6f67726e2f762f737461626c65)](https://packagist.org/packages/ybelenko/ogrn)[![Build Status](https://github.com/ybelenko/ogrn/actions/workflows/ci.yml/badge.svg)](https://github.com/ybelenko/ogrn/actions/workflows/ci.yml)[![Coverage Status](https://camo.githubusercontent.com/e2cda22c2a74ed61b887d05f865d4c7f3805f1460f9b96e0cf3fe0f75029a505/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7962656c656e6b6f2f6f67726e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/ybelenko/ogrn?branch=master)[![License](https://camo.githubusercontent.com/c0ce14207770ffab0b728b993861a1bd55f0427c96f8283f47e892e99c2cb84c/68747470733a2f2f706f7365722e707567782e6f72672f7962656c656e6b6f2f6f67726e2f6c6963656e7365)](https://packagist.org/packages/ybelenko/ogrn)

Tiny PHP library for validating OGRN(ОГРН) and OGRNIP(ОГРНИП) business identifiers in Russia. It just verifies number length and last control digit, so if identifier passes validation it doesn't mean that it exists in a real world. If you need to check that OGRN or OGRNIP exists visit .

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

[](#installation)

It's recommended that you use [Composer](https://getcomposer.org/) to install.

```
$ composer require ybelenko/ogrn
```

Usage
-----

[](#usage)

```
require_once __DIR__ . '/vendor/autoload.php';

use Ybelenko\Ogrn\Ogrn;
use Ybelenko\Ogrn\Ogrnip;

// when you need to validate OGRN number
$isValid = Ogrn::validate("1127746509780");// returns true if identifier is valid

// when you need to validate OGRNIP number
$isValid = Ogrnip::validate("304500116000157");// returns true if identifier is valid
```

> While 32 bit systems have a maximum signed integer range of -2147483648 to 2147483647 you always should store OGRN and OGRNIP identifiers as string.

```
$ogrn = 1127746509780; // is bad
echo $ogrn; // 2147483647

$ogrn = '1127746509780'; // is good
echo $ogrn; // 1127746509780
```

Tests
-----

[](#tests)

To execute the test suite, you'll need to clone current repo and install it with dev dependencies:

```
$ git clone https://github.com/ybelenko/ogrn
$ cd ogrn
$ composer install
$ composer test
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity69

Established project with proven stability

 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

Every ~1760 days

Total

2

Last Release

1515d ago

Major Versions

v1.0.0 → v2.0.02022-03-21

PHP version history (2 changes)v1.0.0PHP ^5.3.3 || ^7.0

v2.0.0PHP ^7.0 || ^8.0

### Community

Maintainers

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

---

Top Contributors

[![ybelenko](https://avatars.githubusercontent.com/u/5541023?v=4)](https://github.com/ybelenko "ybelenko (15 commits)")

---

Tags

businessidentifiersrussianvalidationvalidationbusinessогрнОГРНИПidentifiers

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ybelenko-ogrn/health.svg)

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

###  Alternatives

[composer/semver

Version comparison library that offers utilities, version constraint parsing and validation.

3.3k489.6M672](/packages/composer-semver)[giggsey/libphonenumber-for-php

A library for parsing, formatting, storing and validating international phone numbers, a PHP Port of Google's libphonenumber.

5.0k148.7M416](/packages/giggsey-libphonenumber-for-php)[respect/validation

The most awesome validation engine ever created for PHP

5.9k37.4M383](/packages/respect-validation)[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M107](/packages/propaganistas-laravel-phone)[opis/json-schema

Json Schema Validator for PHP

64236.9M186](/packages/opis-json-schema)[giggsey/libphonenumber-for-php-lite

A lite version of giggsey/libphonenumber-for-php, which is a PHP Port of Google's libphonenumber

8412.9M47](/packages/giggsey-libphonenumber-for-php-lite)

PHPackages © 2026

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