PHPackages                             nakroma/cereal - 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. nakroma/cereal

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

nakroma/cereal
==============

Random and unique key generation.

v1.0.0(9y ago)0102MITPHPPHP &gt;=5.3.0

Since Mar 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Nakroma/cereal)[ Packagist](https://packagist.org/packages/nakroma/cereal)[ RSS](/packages/nakroma-cereal/feed)WikiDiscussions master Synced yesterday

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

[![Latest Version](https://camo.githubusercontent.com/158e2da3d3c3dde9c64624e1639a5fad03737e259e685e81d5c038549efdeda3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e616b726f6d612f63657265616c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/nakroma/cereal/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Cereal
======

[](#cereal)

Cereal generates random unique keys, for example as game or license keys.

Usage
-----

[](#usage)

```
use Nakroma\Cereal;

Cereal::generate();
// Output: B539-F8B7-943B-BAF5-82F6-CCF7-5ACB-B4A2
```

Configuration
-------------

[](#configuration)

You can pass `Cereal::generate()` a bunch of options in an array, like this:

```
Cereal::generate(['length' => 16, 'uppercase' => false]);
```

These are all the options you can use and their default values:

```
length: 32 // Changes the length of the string
// 16 => D423-3332-2919-D000

delimiter: '-' // Changes the char between each chunk
// '@' => FDB2@4C41@C6DD@0B99@7FBD@ADF5@3345@058E

delimiterSpacing: 4 // Changes the chunk size after before each delimiter
// 8 => EA989521-282013EA-49B8D6CB-90DA28D8

uppercase: true // Changes if the string is upper or lower case
// false => c724-bbb9-b205-0995-d8b8-3d65-0e4d-6c3b

numbers: true // Enables the generation of numbers in the key
// false => VHUX-CDDE-CFFG-NKSC-SDEK-LFWX-OBCW-IOZC

chars: true // Enables the generation of chars in the key
// false => 7222-2371-3276-8402-7594-0803-3961-6800
```

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

[](#installation)

Run `composer require nakroma/cereal`

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3394d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6236201?v=4)[Nakroma](/maintainers/Nakroma)[@Nakroma](https://github.com/Nakroma)

---

Top Contributors

[![Nakroma](https://avatars.githubusercontent.com/u/6236201?v=4)](https://github.com/Nakroma "Nakroma (12 commits)")

---

Tags

generationkeyphprandomserialunique-id

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nakroma-cereal/health.svg)

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

PHPackages © 2026

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