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

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

calicastle/cuid
===============

A CUID generator

v2.0.0(5y ago)527.6k↓37.3%MITPHPPHP ^7.2|^8.0

Since Jun 13Pushed 5y ago2 watchersCompare

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

READMEChangelog (3)DependenciesVersions (9)Used By (0)

A CUID Generator
================

[](#a-cuid-generator)

[![](https://camo.githubusercontent.com/9e5222338fcd5d1c28d9c14eeae043d04ebaf4863802a2c788e7e53a8cc9b847/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616c69636173746c652f637569643f7374796c653d666c61742d737175617265)](https://packagist.org/packages/calicastle/cuid)[![Packagist Version](https://camo.githubusercontent.com/c572fc852b594d58def2b7cadae23b03b8fe85b89525d8f23165c3f5970ca2cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63616c69636173746c652f637569643f7374796c653d666c61742d737175617265)](https://packagist.org/packages/calicastle/cuid)

A CUID **(Collision Resistant Unique Identifier)** is a method of creating a unique identifier that was developed by Eric Elliott. The purpose is to create unique IDs for use in web applications to better support horizontal scaling and sequential lookup performance.

Install
-------

[](#install)

```
composer require calicastle/cuid
```

Example Usages
--------------

[](#example-usages)

```
use CaliCastle\Cuid;

Cuid::make(); // ckbe1q3gi000001jsfnm9cm81
Cuid::make('u'); // ukbe1qos1000201js74bwas75
```

### Laravel Eloquent

[](#laravel-eloquent)

```
use CaliCastle\Concerns\HasCuid;

// Each user will have an id of something
// like "ukbe1q3gi000001jsfnm9cm81"
class User extends Model
{
   use HasCuid;

   /**
    * Get the CUID prefix.
    */
   public static function getCuidPrefix(): string
   {
       return 'u';
   }
}
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

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

Every ~40 days

Recently: every ~70 days

Total

8

Last Release

1887d ago

Major Versions

v1.0.6 → v2.0.02021-03-19

PHP version history (2 changes)v1.0.0PHP ^7.2

v2.0.0PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d8ca7546f71caffe5a1ce7c111753ab9ddb370756255ed2ebb51b2199546322c?d=identicon)[cali](/maintainers/cali)

---

Top Contributors

[![CaliCastle](https://avatars.githubusercontent.com/u/10830749?v=4)](https://github.com/CaliCastle "CaliCastle (8 commits)")

---

Tags

uuidunique-idcuidcollision free id

### Embed Badge

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

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

###  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

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

Provides an object-oriented API to generate and represent UIDs

610280.0M754](/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.3M129](/packages/webpatser-laravel-uuid)[godruoyi/php-snowflake

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

8582.3M61](/packages/godruoyi-php-snowflake)[pascaldevink/shortuuid

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

5951.8M15](/packages/pascaldevink-shortuuid)

PHPackages © 2026

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