PHPackages                             collin-peng/unique-id - 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. collin-peng/unique-id

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

collin-peng/unique-id
=====================

Generate unique id

1.0.1(7y ago)019MITPHPPHP ^7.0

Since Nov 7Pushed 7y agoCompare

[ Source](https://github.com/CollinPeng/unique-id)[ Packagist](https://packagist.org/packages/collin-peng/unique-id)[ Docs](https://github.com/CollinPeng/unique-id)[ RSS](/packages/collin-peng-unique-id/feed)WikiDiscussions master Synced 1mo ago

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

unique-id
=========

[](#unique-id)

This library implements uuid and object id(like mongodb object id).

[![Latest Version](https://camo.githubusercontent.com/a39fa365a4ee810626b52ee063ff3f552b35e48a8e3984413ffdfce6a5d12faf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6c6c696e2d70656e672f756e697175652d69642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/collin-peng/unique-id)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Install
-------

[](#install)

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

```
composer require collin-peng/unique-id
```

Usage
-----

[](#usage)

```
use CollinPeng\UniqueId;

$uniqueId = new UniqueId();

// generate object id
$uniqueId->objectId();

// generate uuid
$uniqueId->uuid()
```

Testing
-------

[](#testing)

You can use the following command to test：

```
make test
```

License
-------

[](#license)

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

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

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

Total

2

Last Release

2740d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/418a47bf00ac2c2a901e229b169e049bac407ed215377ac3853871b0607eaf83?d=identicon)[CollinPeng](/maintainers/CollinPeng)

---

Top Contributors

[![CollinPeng](https://avatars.githubusercontent.com/u/25002484?v=4)](https://github.com/CollinPeng "CollinPeng (2 commits)")

---

Tags

uuidObjectId

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/collin-peng-unique-id/health.svg)

```
[![Health](https://phpackages.com/badges/collin-peng-unique-id/health.svg)](https://phpackages.com/packages/collin-peng-unique-id)
```

###  Alternatives

[ramsey/uuid

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

12.6k700.2M3.3k](/packages/ramsey-uuid)[symfony/polyfill-uuid

Symfony polyfill for uuid functions

688335.4M63](/packages/symfony-polyfill-uuid)[symfony/uid

Provides an object-oriented API to generate and represent UIDs

610280.0M750](/packages/symfony-uid)[webpatser/laravel-uuid

Laravel integration for webpatser/uuid - High-performance drop-in UUID replacements (15% faster than Ramsey). Provides Str macros, HasUuids trait, facades, and casts. RFC 4122/9562 compliant.

1.8k17.3M128](/packages/webpatser-laravel-uuid)[pascaldevink/shortuuid

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

5951.8M15](/packages/pascaldevink-shortuuid)[keiko/uuid-shortener

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

150215.4k2](/packages/keiko-uuid-shortener)

PHPackages © 2026

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