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

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

yamaneyuta/ulid
===============

ULID library

v1.0.0(2y ago)013.5k↓51.1%MITPHP

Since Apr 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/yamaneyuta/php-ulid)[ Packagist](https://packagist.org/packages/yamaneyuta/ulid)[ RSS](/packages/yamaneyuta-ulid/feed)WikiDiscussions main Synced 3w ago

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

php-ulid
========

[](#php-ulid)

[![](https://camo.githubusercontent.com/ac702d89bc01a495ea9925e3eb425ac7e8baf5e4e961041a8feb14dc96e5fb23/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d6363632e7376673f6c6f676f3d706870267374796c653d666c6174)](https://camo.githubusercontent.com/ac702d89bc01a495ea9925e3eb425ac7e8baf5e4e961041a8feb14dc96e5fb23/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d6363632e7376673f6c6f676f3d706870267374796c653d666c6174) [![Packagist Version](https://camo.githubusercontent.com/f81e64c57af55507034fe7f2cfbc15df20f3c0e1e4629a2f4091fff5bc8838ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79616d616e65797574612f756c6964)](https://camo.githubusercontent.com/f81e64c57af55507034fe7f2cfbc15df20f3c0e1e4629a2f4091fff5bc8838ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79616d616e65797574612f756c6964) [![License](https://camo.githubusercontent.com/387c0170f61ff60210078078611deaa630f25722d3d3b5f74266914084044328/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f79616d616e65797574612f7068702d756c6964)](https://camo.githubusercontent.com/387c0170f61ff60210078078611deaa630f25722d3d3b5f74266914084044328/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f79616d616e65797574612f7068702d756c6964) [![Lint](https://github.com/yamaneyuta/php-ulid/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/yamaneyuta/php-ulid/actions/workflows/lint.yml/badge.svg?branch=main) [![Test](https://github.com/yamaneyuta/php-ulid/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/yamaneyuta/php-ulid/actions/workflows/test.yml/badge.svg?branch=main) [![Tested on PHP 7.1 to 8.3](https://camo.githubusercontent.com/5b8843232e056e19d2ee97e5ed446b09090ed760710c64993e78be8e48cc23b4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7465737465642532306f6e2d504850253230372e30253230253743253230372e31253230253743253230372e32253230253743253230372e33253230253743253230372e34253230253743253230382e30253230253743253230382e31253230253743253230382e32253230253743253230382e332d627269676874677265656e2e737667)](https://camo.githubusercontent.com/5b8843232e056e19d2ee97e5ed446b09090ed760710c64993e78be8e48cc23b4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7465737465642532306f6e2d504850253230372e30253230253743253230372e31253230253743253230372e32253230253743253230372e33253230253743253230372e34253230253743253230382e30253230253743253230382e31253230253743253230382e32253230253743253230382e332d627269676874677265656e2e737667)

PHPでULID(Universally Unique Lexicographically Sortable Identifier)を生成するためのライブラリです。

UUIDと同じフォーマットでの出力が可能なため、システムへの影響を最小限に、ミリ秒単位でソート可能なIDに置き換えることができます。

また、16進数のフォーマットで出力することも可能なため、128ビットの数値として扱うことも容易です。

使い方
---

[](#使い方)

### インストール

[](#インストール)

```
composer require yamaneyuta/ulid
```

### コード

[](#コード)

新しくULIDを生成

```
use function yamaneyuta\ulid;

echo ulid(); // 01HVTDK9CSD1F58S8YGK6M610X
```

または

```
use yamaneyuta\Ulid;

echo (string)new Ulid(); // 01HVNE93FHMTQ38NSJ81M03H1Y
```

他のフォーマットで出力

```
use yamaneyuta\Ulid;

$ulid = new Ulid();

// UUIDのフォーマットで出力
echo $ulid->toUuid(); // 018eeae8-64fd-06c9-19b6-3138fd763df8

// 16進数のフォーマットで出力
echo $ulid->toHex();  // 018eeae864fd06c919b63138fd763df8
```

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

2

Last Release

789d ago

Major Versions

v0.2.1 → v1.0.02024-04-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c609e5bab6a832ae19baa538700a573445011169122a3c1a39fdf85c40f6b4b?d=identicon)[yamaneyuta](/maintainers/yamaneyuta)

---

Top Contributors

[![yamaneyuta](https://avatars.githubusercontent.com/u/82195292?v=4)](https://github.com/yamaneyuta "yamaneyuta (66 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k77.4k88](/packages/pocketmine-pocketmine-mp)[godruoyi/php-snowflake

An ID Generator for PHP based on Snowflake Algorithm (Twitter announced).

8632.5M65](/packages/godruoyi-php-snowflake)[bitwasp/bitcoin

PHP Bitcoin library with functions for transactions, signatures, serialization, Random/Deterministic ECDSA keys, blocks, RPC bindings

1.1k537.0k43](/packages/bitwasp-bitcoin)[pocketmine/raklib

A RakNet server implementation written in PHP

101584.9k13](/packages/pocketmine-raklib)[bitwasp/buffertools

Toolbox for working with binary and hex data. Similar to NodeJS Buffer.

64774.5k42](/packages/bitwasp-buffertools)[pocketmine/math

PHP library containing math related code used in PocketMine-MP

45591.6k19](/packages/pocketmine-math)

PHPackages © 2026

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