PHPackages                             robinvdvleuten/ulid - 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. robinvdvleuten/ulid

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

robinvdvleuten/ulid
===================

Universally Unique Lexicographically Sortable Identifier (ULID) implementation for PHP.

v5.0.0(5y ago)4583.6M↓12.2%29[2 issues](https://github.com/robinvdvleuten/php-ulid/issues)[3 PRs](https://github.com/robinvdvleuten/php-ulid/pulls)20MITPHPPHP ^7.2|^8.0

Since Jun 17Pushed 3y ago6 watchersCompare

[ Source](https://github.com/robinvdvleuten/php-ulid)[ Packagist](https://packagist.org/packages/robinvdvleuten/ulid)[ Docs](https://github.com/robinvdvleuten/php-ulid)[ RSS](/packages/robinvdvleuten-ulid/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (3)Versions (10)Used By (20)

Universally Unique Lexicographically Sortable Identifier
========================================================

[](#universally-unique-lexicographically-sortable-identifier)

[![Latest Stable Version](https://camo.githubusercontent.com/61f4399e93910cc3c3bff6549913996d823dc868a3d2d4c7ed731f626994df6c/68747470733a2f2f706f7365722e707567782e6f72672f726f62696e7664766c657574656e2f756c69642f762f737461626c65)](https://packagist.org/packages/robinvdvleuten/ulid)[![Build Status](https://camo.githubusercontent.com/3de0bdb66ebe218fc34054ad11d4572ee2722d9beb0d3efe9d27d7d495e086eb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f726f62696e7664766c657574656e2f7068702d756c69642f72756e2d74657374732e7376673f7374796c653d666c61742d737175617265)](https://github.com/robinvdvleuten/php-ulid/actions?query=workflow%3Arun-tests)

A PHP port of [ulid/javascript](https://github.com/ulid/javascript) with some minor improvements.

[ ![Sponsored by The Webstronauts](https://camo.githubusercontent.com/42d3c48e4f63f35f5c64f19384a32033a73499b89dc89c6bae3c7b69e7580313/68747470733a2f2f7765627374726f6e617574732e636f6d2f6261646765732f73706f6e736f7265642d62792d7765627374726f6e617574732e737667)](https://webstronauts.com/)Installation
------------

[](#installation)

You can install the package via [Composer](https://getcomposer.org).

```
composer require robinvdvleuten/ulid
```

Usage
-----

[](#usage)

```
use Ulid\Ulid;

$ulid = Ulid::generate();
echo (string) $ulid; // 01B8KYR6G8BC61CE8R6K2T16HY

// Or if you prefer a lowercased output
$ulid = Ulid::generate(true);
echo (string) $ulid; // 01b8kyr6g8bc61ce8r6k2t16hy

// If you need the timestamp from an ULID instance
$ulid = Ulid::generate();
echo $ulid->toTimestamp(); // 1561622862

// You can also generate a ULID for a specific UNIX-time in milliseconds
$ulid = Ulid::fromTimestamp(1593048767015);
// or with a lower cased output: $ulid = Ulid::fromTimestamp(1593048767015, true);
echo (string) $ulid; // 01EBMHP6H7TT1Q4B7CA018K5MQ
```

### Testing

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [the GitHub "Releases" page](https://github.com/robinvdvleuten/php-ulid/releases) for more information on what has changed recently.

Credits
-------

[](#credits)

As it's just a simple port of JavaScript to PHP code. All credits should go to the original [ULID](https://github.com/ulid/spec) specs.

- [Robin van der Vleuten](https://github.com/robinvdvleuten)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity63

Solid adoption and visibility

Community36

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 73.9% 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 ~158 days

Recently: every ~132 days

Total

9

Last Release

1989d ago

Major Versions

v1.1.0 → v2.0.02018-10-30

v2.0.0 → v3.0.02019-01-20

v3.0.0 → v4.0.02019-06-27

v4.1.0 → v5.0.02020-12-06

PHP version history (3 changes)v2.0.0PHP &gt;=5.5.0

v3.0.0PHP ^7.1

v5.0.0PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/074cb4e1046125c06710b447947c86ee0466d687d89fe0582bf9b9dd4cb351ac?d=identicon)[robinvdvleuten](/maintainers/robinvdvleuten)

---

Top Contributors

[![robinvdvleuten](https://avatars.githubusercontent.com/u/238295?v=4)](https://github.com/robinvdvleuten "robinvdvleuten (34 commits)")[![bepsvpt](https://avatars.githubusercontent.com/u/8221099?v=4)](https://github.com/bepsvpt "bepsvpt (2 commits)")[![dataground](https://avatars.githubusercontent.com/u/294096?v=4)](https://github.com/dataground "dataground (1 commits)")[![devrck](https://avatars.githubusercontent.com/u/16414298?v=4)](https://github.com/devrck "devrck (1 commits)")[![garak](https://avatars.githubusercontent.com/u/179866?v=4)](https://github.com/garak "garak (1 commits)")[![hvt](https://avatars.githubusercontent.com/u/337754?v=4)](https://github.com/hvt "hvt (1 commits)")[![OndraM](https://avatars.githubusercontent.com/u/793041?v=4)](https://github.com/OndraM "OndraM (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![raphaelstolt](https://avatars.githubusercontent.com/u/48225?v=4)](https://github.com/raphaelstolt "raphaelstolt (1 commits)")[![sandrokeil](https://avatars.githubusercontent.com/u/3597436?v=4)](https://github.com/sandrokeil "sandrokeil (1 commits)")[![tkrtmy](https://avatars.githubusercontent.com/u/4525749?v=4)](https://github.com/tkrtmy "tkrtmy (1 commits)")[![cfreeh](https://avatars.githubusercontent.com/u/1627764?v=4)](https://github.com/cfreeh "cfreeh (1 commits)")

---

Tags

generatorhacktoberfestidentifierphpulid

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/robinvdvleuten-ulid/health.svg)

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

###  Alternatives

[jbzoo/composer-diff

See what has changed after a composer update.

53888.9k1](/packages/jbzoo-composer-diff)

PHPackages © 2026

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