PHPackages                             y0x54a/oid-php - 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. y0x54a/oid-php

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

y0x54a/oid-php
==============

y0x54a/oid-php

0.1.0(3y ago)230Apache-2.0PHPPHP &gt;=7.2.5

Since Aug 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/y0x54a/oid-php)[ Packagist](https://packagist.org/packages/y0x54a/oid-php)[ RSS](/packages/y0x54a-oid-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

oid-php
=======

[](#oid-php)

[![packagist](https://camo.githubusercontent.com/18a69b7a7febd0600fa60522aeb5959e14cd65a898dabd415026b420223b1469/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7930783534612f6f69642d706870)](https://packagist.org/packages/y0x54a/oid-php)[![Build Status](https://github.com/y0x54a/oid-php/workflows/ci/badge.svg?branch=main)](https://github.com/y0x54a/oid-php/actions)[![codecov](https://camo.githubusercontent.com/379faf922bdd7c9d7b8f1b582f7cd9f3c3a614600d98b38a92074ea1b5864921/68747470733a2f2f636f6465636f762e696f2f67682f7930783534612f6f69642d7068702f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d31395854595352444c51)](https://codecov.io/gh/y0x54a/oid-php)

Installing
----------

[](#installing)

```
composer require y0x54a/oid-php
```

Example
-------

[](#example)

```
use Y0x54a\Oid\Oid453;
use Y0x54a\Oid\Oid563;
```

```
Oid453::create();
// 12-byte

Oid563::create();
// 14-byte
```

```
$oid = new Oid453('00112233445566778899aabb');

$oid->getId();
// 00112233445566778899aabb

$oid->getTimestamp();
// 1122867

$oid->getRandom();
// 293490554760

$oid->getIndex();
// 10070715

$oid->__toString();
// 00112233445566778899aabb

Oid453::validate($oid);
// true

Oid453::validate($oid->getId());
// true

Oid453::validate('00112233445566778899AABB');
// false

Oid563::validate($oid);
// false
```

```
$oid1 = Oid453::create(1122867);
$oid2 = Oid453::create($oid1);

$oid1->getId() === $oid2->getId();
// true

$oid1->getTimestamp();
// 1122867

$oid2->getTimestamp();
// 1122867

Oid453::generate(1122867);
// 00112233...
```

```
$oid = new Oid563('00112233445566778899aabbccdd');

$oid->getId();
// 00112233445566778899aabbccdd

$oid->getTimestamp();
// 287454020

$oid->getRandom();
// 93898580466090

$oid->getIndex();
// 12307677

$oid->__toString();
// 00112233445566778899aabbccdd

Oid563::validate($oid);
// true

Oid563::validate($oid->getId());
// true

Oid563::validate('00112233445566778899AABBCCDD');
// false

Oid453::validate($oid);
// false
```

```
$oid1 = Oid563::create(287454020);
$oid2 = Oid563::create($oid1);

$oid1->getId() === $oid2->getId();
// true

$oid1->getTimestamp();
// 287454020

$oid2->getTimestamp();
// 287454020

Oid563::generate(287454020);
// 0011223344...
```

API
---

[](#api)

- ### OidInterface

    [](#oidinterface)

    - **Methods**
    - `getId(): string`
    - `getTimestamp(): int`
    - `getRandom(): int`
    - `getIndex(): int`
    - `__toString(): string`
- ### Oid453

    [](#oid453)

    - **Methods**
    - `__construct(string | OidInterface $id)`
    - `getId(): string`
    - `getTimestamp(): int`
    - `getRandom(): int`
    - `getIndex(): int`
    - `__toString(): string`
    - **Static Methods**
    - `create(string | OidInterface | int $id = null): Oid453`
    - `validate(string | OidInterface $id): bool`
    - `generate(int $timestamp): string`
- ### Oid563

    [](#oid563)

    - **Methods**
    - `__construct(string | OidInterface $id)`
    - `getId(): string`
    - `getTimestamp(): int`
    - `getRandom(): int`
    - `getIndex(): int`
    - `__toString(): string`
    - **Static Methods**
    - `create(string | OidInterface | int $id = null): Oid563`
    - `validate(string | OidInterface $id): bool`
    - `generate(int $timestamp): string`

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

1371d ago

### Community

Maintainers

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

---

Top Contributors

[![y0x54a](https://avatars.githubusercontent.com/u/106418451?v=4)](https://github.com/y0x54a "y0x54a (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/y0x54a-oid-php/health.svg)

```
[![Health](https://phpackages.com/badges/y0x54a-oid-php/health.svg)](https://phpackages.com/packages/y0x54a-oid-php)
```

PHPackages © 2026

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