PHPackages                             orbit-id/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. orbit-id/php

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

orbit-id/php
============

Orbit ID reference implementation for PHP (v2 root; v1 under OrbitId\\V1)

v2.0.1(2w ago)02Apache-2.0PHPPHP ^8.1

Since Jul 14Pushed 2w agoCompare

[ Source](https://github.com/orbit-id/php)[ Packagist](https://packagist.org/packages/orbit-id/php)[ Docs](https://github.com/orbit-id/orbit-id/tree/main/packages/php)[ RSS](/packages/orbit-id-php/feed)WikiDiscussions main Synced 1w ago

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

Orbit ID for PHP
================

[](#orbit-id-for-php)

Pure-PHP implementation of Orbit ID. It requires PHP 8.1 or later and has no runtime Composer dependencies: IDs and timestamps are represented as canonical decimal strings (v2: unsigned 128-bit; v1: unsigned 64-bit), so the full range works without GMP or BCMath.

- **v2** (`OrbitId\` / `OrbitId\V2\` alias): Stable 128-bit wire format
- **v1** (`OrbitId\V1\`): stable 64-bit wire format

Consumer migration: [1.x → 2.0.0](../../docs/en/migration-1x-to-2.0.0.md). Registry `2.0.0` cut is slice J of the [promotion plan](../../docs/en/v2-package-2.0.0.md).

Install
-------

[](#install)

```
composer require orbit-id/php
```

Publishing uses a [`orbit-id/php`](https://github.com/orbit-id/php) mirror of this directory for Packagist — see [Packagist publishing](../../docs/en/packagist.md)and [Cross-registry versioning](../../docs/en/cross-registry-versioning.md).

API
---

[](#api)

```
use OrbitId\OrbitGenerator;
use OrbitId\V1\OrbitGenerator as OrbitGeneratorV1;
use function OrbitId\parse;

// v2 (default)
$generator = new OrbitGenerator(['node' => 7]);
$id = $generator->generate(1); // canonical unsigned decimal string
$fields = parse($id);

// v1
$v1 = new OrbitGeneratorV1(['node' => 7]);
$v1Id = $v1->generate(1);
$v1Fields = \OrbitId\V1\OrbitId::parse($v1Id);
```

The `OrbitId` namespace exports `encode`, `decode`, `parse`, `getFormatVersion`, `getTimestamp`, `getType`, `getNode`, `getSequence`, `getRegion`, `getTenant`, `getReserved`, `isValid`, `toDecimalString`, `fromDecimalString`, `toHexString`, `toUnixTimeMs`, and `fromUnixTimeMs`. The same helpers are also available as static methods on `OrbitId\OrbitId`. Class aliases under `OrbitId\V2\` resolve to the root types (function aliases are not provided).

`OrbitGenerator` accepts `node`, optional `region` / `tenant`, optional `clock`, optional `clockRollbackToleranceMs`, `onSequenceExhausted` (`wait` or `fail`), and an optional `confirmOwnership` callback. `generate(0)` is rejected because type zero is reserved. Issued IDs use `FormatVersion = 1` and `Reserved = 0`. Errors are `OrbitId\OrbitError`; inspect its public `$orbitCode` for the stable cross-language error code (including `INVALID_FORMAT_VERSION` / `INVALID_REGION` / `INVALID_TENANT` / `INVALID_RESERVED`).

`isValid` checks structural validity only. It does not prove that an ID was issued by an Orbit generator.

Test
----

[](#test)

```
composer install
composer test
```

The PHPUnit suite consumes the shared fixtures in [`spec/conformance/`](../../spec/conformance/).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance97

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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 ~7 days

Total

5

Last Release

16d ago

Major Versions

v1.1.1 → v2.0.02026-08-14

### Community

Maintainers

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

---

Top Contributors

[![ponstream24](https://avatars.githubusercontent.com/u/87808547?v=4)](https://github.com/ponstream24 "ponstream24 (9 commits)")

---

Tags

uuididentifieridsnowflakeorbit

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/orbit-id-php/health.svg)

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

###  Alternatives

[ramsey/uuid

A PHP library for generating and working with universally unique identifiers (UUIDs).

12.6k778.7M4.5k](/packages/ramsey-uuid)[pascaldevink/shortuuid

PHP 7.4+ library that generates concise, unambiguous, URL-safe UUIDs

5911.9M17](/packages/pascaldevink-shortuuid)[ramsey/identifier

A PHP library for generating and working with identifiers, including UUIDs, ULIDs, and Snowflakes

6112.5k2](/packages/ramsey-identifier)[identifier/identifier

Common Interfaces and Factories for Identifiers

3139.1k1](/packages/identifier-identifier)[keiko/uuid-shortener

A simple shortener library for RFC 4122 compatible UUIDs. Change your 36 chars long UUID into it's shorter equivalent.

150235.6k3](/packages/keiko-uuid-shortener)[pugx/shortid-php

An implementation of shortid in PHP

52637.7k4](/packages/pugx-shortid-php)

PHPackages © 2026

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