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

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

tuupola/ulid
============

Universally Unique Lexicographically Sortable Identifier

0.2.0(4y ago)49.8k↓50%1MITPHPPHP ^7.1|^8.0CI failing

Since Apr 15Pushed 4y ago1 watchersCompare

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

READMEChangelogDependencies (7)Versions (3)Used By (0)

\[WIP\] PHP ULID
================

[](#wip-php-ulid)

This library implements the [Universally Unique Lexicographically Sortable Identifier](https://github.com/alizain/ulid) from Alizain Feerasta.

[![Latest Version](https://camo.githubusercontent.com/149d9471f4162160558158b2f57c1a7b04483f69b9e895fe2aac5da744523a0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747575706f6c612f756c69642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tuupola/ulid)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/e5c22441b46415e1b95fcab37394fe87980509e9f5201c48fd88e575179c38c6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f747575706f6c612f756c69642f54657374732f6d61737465723f7374796c653d666c61742d737175617265)](https://github.com/tuupola/ulid/actions)[![Coverage](https://camo.githubusercontent.com/f506cf8a1861b00ca157326aedbbf30d54d6ea3ad6b8ece4b049c1798f868f2f/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f747575706f6c612f756c69642e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/github/tuupola/ulid)

Install
-------

[](#install)

Install with [composer](https://getcomposer.org/).

```
$ composer require tuupola/ulid
```

Usage
-----

[](#usage)

```
use Tuupola\Ulid;

$ulid = new Ulid;

print $ulid; /* 0001DD70YKYBES1P98DHWKTWZW */

//$ulid = ulid::fromString("0o5Fs0EELR0fUjHjbCnEtdUwQe3");

print $ulid->timestamp(); /* 1523811283 */
print bin2hex($ulid->payload()); /* f2dd90d9286c793d73fc */

$datetime = (new \DateTimeImmutable)
    ->setTimestamp($ulid->unixtime())
    ->setTimeZone(new \DateTimeZone("UTC"));

print $datetime->format("Y-m-d H:i:s"); /* 2018-04-15 16:54:43 */
```

Testing
-------

[](#testing)

You can run tests either manually or automatically on every code change. Automatic tests require [entr](http://entrproject.org/) to work.

```
$ composer test
```

```
$ brew install entr
$ composer watch
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

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

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.7% 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 ~1284 days

Total

2

Last Release

1670d ago

PHP version history (2 changes)0.1.0PHP ^5.6 || ^7.0

0.2.0PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3325405a7d8a43bc40dd0e760a4b7f268fba32a7150cf0327f64f13d1661df0b?d=identicon)[tuupola](/maintainers/tuupola)

---

Top Contributors

[![tuupola](https://avatars.githubusercontent.com/u/21913?v=4)](https://github.com/tuupola "tuupola (18 commits)")[![keithy](https://avatars.githubusercontent.com/u/193501?v=4)](https://github.com/keithy "keithy (1 commits)")

---

Tags

ulid

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[symfony/uid

Provides an object-oriented API to generate and represent UIDs

610280.0M754](/packages/symfony-uid)[hidehalo/nanoid-php

A copy of nanoid in PHP

8124.1M41](/packages/hidehalo-nanoid-php)[paragonie/random-lib

A Library For Generating Secure Random Numbers

703.3M26](/packages/paragonie-random-lib)[jasonhinkle/php-gpg

GPG / PGP port written in pure PHP with no binary dependencies

116147.2k1](/packages/jasonhinkle-php-gpg)[gpslab/base64uid

Generate UID like YouTube

68103.4k](/packages/gpslab-base64uid)[michalsn/codeigniter4-uuid

UUID and ULID package for CodeIgniter 4 with support for Model.

4728.7k4](/packages/michalsn-codeigniter4-uuid)

PHPackages © 2026

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