PHPackages                             endyjasmi/cuid - 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. endyjasmi/cuid

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

endyjasmi/cuid
==============

Cuid php port

2.1.0(6y ago)72661.1k↓49.5%9[1 issues](https://github.com/endyjasmi/cuid/issues)[2 PRs](https://github.com/endyjasmi/cuid/pulls)7MITPHPPHP &gt;= 5.4

Since Nov 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/endyjasmi/cuid)[ Packagist](https://packagist.org/packages/endyjasmi/cuid)[ RSS](/packages/endyjasmi-cuid/feed)WikiDiscussions master Synced 1w ago

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

> This package has been deprecated in favor of [CUID2](https://github.com/paralleldrive/cuid2).

Cuid for PHP [!\[Gitter\](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/endyjasmi/cuid?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
==============================================================================================================================================================================

[](#cuid-for-php-gitterhttpsbadgesgitterimjoin-chatsvg)

[![Build Status](https://camo.githubusercontent.com/568213bec303428e6f4c4a5a2dc9fc4d9ac85e2b1457339f61d25ebdef0fea9a/68747470733a2f2f7472617669732d63692e6f72672f656e64796a61736d692f637569642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/endyjasmi/cuid) [![Coverage Status](https://camo.githubusercontent.com/c8f0d6880dc410422bf8a50b04637585a56e0c31e117f5a813c50a00d5765cdf/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f656e64796a61736d692f637569642f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/endyjasmi/cuid?branch=master) [![SensioLabsInsight](https://camo.githubusercontent.com/67c62bb32f9ba3c93e974a704cc8957f893ae42999e97ba63c90935ae55213f7/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f34396463633331362d336630302d343537332d613163312d3931646564666661313832392f6d696e692e706e67)](https://insight.sensiolabs.com/projects/49dcc316-3f00-4573-a1c1-91dedffa1829) [![Latest Stable Version](https://camo.githubusercontent.com/3656fd376029e05242e80668e1b69114b8bbf180140d44aca62475a80ed23bce/68747470733a2f2f706f7365722e707567782e6f72672f656e64796a61736d692f637569642f762f737461626c652e737667)](https://packagist.org/packages/endyjasmi/cuid) [![Total Downloads](https://camo.githubusercontent.com/94cdee87e7c31ab0804eebd7fccec1e115631934e526ce941a9f15d3c85911ac/68747470733a2f2f706f7365722e707567782e6f72672f656e64796a61736d692f637569642f646f776e6c6f6164732e737667)](https://packagist.org/packages/endyjasmi/cuid) [![License](https://camo.githubusercontent.com/257206b8cd51a82de7dcec416c3d83ff9a89acd57ff1dc9f6cf344b3b2d2668b/68747470733a2f2f706f7365722e707567782e6f72672f656e64796a61736d692f637569642f6c6963656e73652e737667)](https://packagist.org/packages/endyjasmi/cuid)

This library provides a collision resistant id (hashes) for horizontal scaling and sequential lookup performance. This README will only cover basic detail and PHP specific implementation.

**Do [refer to the original project](http://usecuid.org/) for the full description of the project.**

Requirement
-----------

[](#requirement)

1. PHP 5.4 and above

Installation
------------

[](#installation)

This library can be installed through composer. Just add the following to your `composer.json` and run `composer install`.

```
{
	"require": {
		"endyjasmi/cuid": "2.*"
	}
}
```

Quickstart
----------

[](#quickstart)

Here's how to use it

```
// Include composer autoloader
require 'vendor/autoload.php';

// Create a cuid instance
$cuid = new EndyJasmi\Cuid;

// Generate normal cuid
$normalCuid = $cuid->cuid(); // ci27flk5w0002adx5dhyvzye2

// Generate short cuid
$shortCuid = $cuid->slug(); // 6503a5k0

// You can also generate cuid using static method
$normalCuid = Cuid::cuid();
$shortCuid = Cuid::slug();

// There is also an alias method for better readability
$normalCuid = Cuid::make();
```

License
-------

[](#license)

This library is licensed under MIT as shown below. Exact copy of the license can be found in `LICENSE` file.

```
The MIT License (MIT)

Copyright (c) 2014 Endy Jasmi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

```

Feedback
========

[](#feedback)

Want to say hello to me? You can reach me at  or

[!\[Gitter\](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/endyjasmi/cuid?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 92.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 ~941 days

Total

3

Last Release

2351d ago

Major Versions

1.0.0 → 2.0.02014-11-08

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1048745?v=4)[Endy Jasmi](/maintainers/endyjasmi)[@endyjasmi](https://github.com/endyjasmi)

---

Top Contributors

[![endyjasmi](https://avatars.githubusercontent.com/u/1048745?v=4)](https://github.com/endyjasmi "endyjasmi (38 commits)")[![crabmusket](https://avatars.githubusercontent.com/u/904269?v=4)](https://github.com/crabmusket "crabmusket (1 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")[![LasseRafn](https://avatars.githubusercontent.com/u/2689341?v=4)](https://github.com/LasseRafn "LasseRafn (1 commits)")

---

Tags

uuidguidUIDidcuid

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/endyjasmi-cuid/health.svg)

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

###  Alternatives

[ramsey/uuid

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

12.6k729.6M3.8k](/packages/ramsey-uuid)[symfony/uid

Provides an object-oriented API to generate and represent UIDs

616303.9M1.1k](/packages/symfony-uid)[pascaldevink/shortuuid

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

5941.8M16](/packages/pascaldevink-shortuuid)[identifier/identifier

Common Interfaces and Factories for Identifiers

3231.4k1](/packages/identifier-identifier)[ramsey/identifier

A PHP library for generating and working with identifiers, including UUIDs, ULIDs, and Snowflakes

605.2k2](/packages/ramsey-identifier)[emadadly/laravel-uuid

laravel uuid a simple, automatic UUID generator for any model based on Laravel.

120418.5k3](/packages/emadadly-laravel-uuid)

PHPackages © 2026

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