PHPackages                             jchook/uuid - 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. jchook/uuid

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

jchook/uuid
===========

Fast, Secure UUIDs

v1.0.0(8y ago)867.4k↓28.6%MITPHP

Since Apr 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jchook/uuid-v4)[ Packagist](https://packagist.org/packages/jchook/uuid)[ RSS](/packages/jchook-uuid/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Fast, Secure, Random UUIDs
==========================

[](#fast-secure-random-uuids)

Pure PHP.

Generate RFC-4122 compliant [random UUIDs](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29)with better [statistical dispersion](https://en.wikipedia.org/wiki/Statistical_dispersion)than `mt_rand()`, and **5x faster** than `create_uuid()`.

Example Usage
-------------

[](#example-usage)

If you are using composer, make sure you `require 'vendor/autoload.php`, then the code should Just Work™. Otherwise you can require `lib/Uuid.php` directly.

```

```

Install w/ Composer
-------------------

[](#install-w-composer)

```
composer require jchook/uuid

```

Requirements
------------

[](#requirements)

- PHP 7.0+

Features
--------

[](#features)

- Very fast!
- Pure PHP implementation
- Cryptographically secure PRNG

Performance
-----------

[](#performance)

Surprisingly, this library is **5x faster** than the [PECL UUID extension](https://pecl.php.net/package/UUID).

packageperformancePECL UUID300k ops/sec**meter/uuid****1.5M ops/sec**Q&amp;A
-------

[](#qa)

### What is UUID v4?

[](#what-is-uuid-v4)

**U**niversally **U**nique **ID**entifiers transcend many constraints of traditional incremental integer IDs, especially in distributed systems. Version 4 means that it's random, instead of being based on the current time, etc. This purely random ID [has](https://stackoverflow.com/questions/20342058/which-uuid-version-to-use) [many](http://www.sohamkamani.com/blog/2016/10/05/uuid1-vs-uuid4/) [advantages](https://stackoverflow.com/questions/703035/when-are-you-truly-forced-to-use-uuid-as-part-of-the-design/786541#786541).

### What about collisions?

[](#what-about-collisions)

The chance of a collision is so vanishingly small that it is [arguably smaller than UUID V1's collision probability](https://blogs.msdn.microsoft.com/oldnewthing/20160114-00/?p=92851). For scale, you would need to do-loop `Uuid::v4()` at max speed for 100,000 years to achieve a 50% chance of **one** collision.

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

2962d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/047da3410a118e06b8f9e170318c1c1197a6dbd5ceebe1a43ee91251d49c7632?d=identicon)[jchook](/maintainers/jchook)

---

Top Contributors

[![jchook](https://avatars.githubusercontent.com/u/193530?v=4)](https://github.com/jchook "jchook (1 commits)")

### Embed Badge

![Health badge](/badges/jchook-uuid/health.svg)

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

PHPackages © 2026

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