PHPackages                             iliain/php-zoo-ids - 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. iliain/php-zoo-ids

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

iliain/php-zoo-ids
==================

A PHP version of bryanmylee's zoo-ids, originally written in JavaScript

2.0.0(1y ago)06BSD-3-ClausePHPPHP ^7 || ^8

Since Nov 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Iliain/php-zoo-ids)[ Packagist](https://packagist.org/packages/iliain/php-zoo-ids)[ Docs](http://github.com/Iliain/php-zoo-ids)[ RSS](/packages/iliain-php-zoo-ids/feed)WikiDiscussions main Synced 1mo ago

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

php-zoo-ids
===========

[](#php-zoo-ids)

[![Latest Stable Version](https://camo.githubusercontent.com/1a4a1d890e5bbdafec2e58484b27188ba2ee7df31b2034b0057f1d2ee0774228/68747470733a2f2f706f7365722e707567782e6f72672f696c6961696e2f7068702d7a6f6f2d6964732f76)](https://packagist.org/packages/iliain/php-zoo-ids)[![Total Downloads](https://camo.githubusercontent.com/e2a8ca8abab8078df77bd6ff63c57f1ca075cf88004016a3d6701e57fe95c250/68747470733a2f2f706f7365722e707567782e6f72672f696c6961696e2f7068702d7a6f6f2d6964732f646f776e6c6f616473)](https://packagist.org/packages/iliain/php-zoo-ids)[![Latest Unstable Version](https://camo.githubusercontent.com/0cbbe3bd5c796384b24095d1a2248f234cefdd5d17c4e5e0a718127c1cd10be4/68747470733a2f2f706f7365722e707567782e6f72672f696c6961696e2f7068702d7a6f6f2d6964732f762f756e737461626c65)](https://packagist.org/packages/iliain/php-zoo-ids)[![License](https://camo.githubusercontent.com/3acdb7130f07f5c6a331393829a49e9fc6d6aa9a6699d26cbd8ad1b758a2af4f/68747470733a2f2f706f7365722e707567782e6f72672f696c6961696e2f7068702d7a6f6f2d6964732f6c6963656e7365)](https://packagist.org/packages/iliain/php-zoo-ids)[![PHP Version Require](https://camo.githubusercontent.com/947658ca7cb62378bb705dbefb3e73cd599f20d6ed158d86f8bdc2ca781ce0c2/68747470733a2f2f706f7365722e707567782e6f72672f696c6961696e2f7068702d7a6f6f2d6964732f726571756972652f706870)](https://packagist.org/packages/iliain/php-zoo-ids)

A PHP version of [bryanmylee's zoo-ids](https://github.com/bryanmylee/zoo-ids), originally written in JavaScript, which was in turn inspired by the URL ID's of [gfycat.com](https://gfycat.com). For a frontend or backend that uses JavaScript, I highly recommend you use their package!

Generate **predictable** and **unique** identifiers composed of adjectives and animal names, with the ability to seed the random identifiers.

Range of IDs
------------

[](#range-of-ids)

Currently, there are 1347 adjectives and 221 animals. The more adjectives used, the more possible combinations of IDs available.

For a quick reference, with 2 adjectives used, there are 400,984,389 possible unique IDs.

With 3 adjectives, there are 540,125,971,983 possible unique IDs.

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

[](#installation)

```
$ composer require iliain/php-zoo-ids
```

Usage
-----

[](#usage)

### Examples

[](#examples)

```
use Iliain\ZooIDs\UsernameRandomizer;

$randomizer = new UsernameRandomizer();
$randomizer->generateID('short seed'); // KnobbyNauticalKingfisher

// Defaults to the current time if seed is null.
$randomizer->generateID(null, 2, '🍓', 'lowercase'); // enchanted🍓narrow🍓wallaby
```

If you want to control the list of Nouns and Adjectives, you can provide your own:

```
$randomizer = new UsernameRandomizer(['Jumping','Flying','Running','Waving'], ['Rock', 'Paper', 'Scissors']);
$randomizer->generateID(); // JumpingRunningScissors

$randomizer->setAdjectives(['Diving','Walking','Spinning']);
$randomizer->generateID(); // WalkingDivingScissors

$randomizer->setNouns(['Koala', 'Dog']);
$randomizer->generateID(); // WalkingDivingKoala
```

### Documentation

[](#documentation)

#### `new UsernameRandomizer($adjectives, $nouns)`

[](#new-usernamerandomizeradjectives-nouns)

##### `adjectives: array`

[](#adjectives-array)

An array of adjectives to use in generation. Defaults to preprovided list if none are specified.

##### `nouns: array`

[](#nouns-array)

An array of nouns to use in generation. Defaults to preprovided list if none are specified.

#### `generateID($seed, $numAdjectives, $delimiter, $caseStyle)`

[](#generateidseed-numadjectives-delimiter-casestyle)

##### `seed: string|int`

[](#seed-stringint)

The seed used to generate the id. This allows us to generate predictable, but random and unique identifiers.

Defaults to the current time.

##### `numAdjectives: int`

[](#numadjectives-int)

The number of adjectives to use in the identifier.

Defaults to `2`.

##### `delimiter: string`

[](#delimiter-string)

The delimiter used between words. The delimiter will also be used between multi-word adjectives.

Defaults to `''`.

##### `caseStyle: string`

[](#casestyle-string)

The case style for the words. Possible options are `'titlecase'`, `'camelcase'`, `'uppercase'`, `'lowercase'`, and `'togglecase'`.

```
generateID($seed, $numAdjectives, $delimiter, 'titlecase'); // FineAntiqueElk

generateID($seed, $numAdjectives, $delimiter, 'camelcase'); // pertinentPoshGoldfinch

generateID($seed, $numAdjectives, $delimiter, 'uppercase'); // PIERCINGRESPONSIBLECAMEL

generateID($seed, $numAdjectives, $delimiter, 'lowercase'); // imaginarywingedsalamander

generateID($seed, $numAdjectives, $delimiter, 'togglecase'); // sTuNnInGdEsCrIpTiVepEaFoWl
```

Defaults to `'titlecase'`.

Credits
-------

[](#credits)

All credit goes to [Bryan Lee](https://github.com/bryanmylee) and his [zoo-ids](https://github.com/bryanmylee/zoo-ids) package. I wanted a version of this to use in PHP (username generation was handled by a PHP CMS), and converted the majority of his existing code to that format. Currently lacking some of his original features, such as the ability to use objects as seeds.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Total

2

Last Release

575d ago

Major Versions

1.0.0 → 2.0.02024-10-16

PHP version history (2 changes)1.0.0PHP ^7

2.0.0PHP ^7 || ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/95555999d61957aa18a23d42afe8bcf7aad3a5e6d9dcc8c7e41ba183f405e49e?d=identicon)[iliain](/maintainers/iliain)

---

Top Contributors

[![Iliain](https://avatars.githubusercontent.com/u/2579262?v=4)](https://github.com/Iliain "Iliain (19 commits)")

---

Tags

adjectivesgeneratoridsnounsphprandomrandom-generationunique-identifiersusername-generatorusernamesrandomusernameszoo-ids

### Embed Badge

![Health badge](/badges/iliain-php-zoo-ids/health.svg)

```
[![Health](https://phpackages.com/badges/iliain-php-zoo-ids/health.svg)](https://phpackages.com/packages/iliain-php-zoo-ids)
```

###  Alternatives

[paragonie/random_compat

PHP 5.x polyfill for random\_bytes() and random\_int() from PHP 7

8.2k655.0M405](/packages/paragonie-random-compat)[ircmaxell/random-lib

A Library For Generating Secure Random Numbers

84130.2M119](/packages/ircmaxell-random-lib)[mistic100/randomcolor

Generate attractive random colors

2431.4M6](/packages/mistic100-randomcolor)[pragmarx/random

Create random chars, numbers, strings

714.2M5](/packages/pragmarx-random)[paragonie/random-lib

A Library For Generating Secure Random Numbers

703.3M26](/packages/paragonie-random-lib)[nubs/random-name-generator

A library to create interesting, sometimes entertaining, random names.

135680.2k3](/packages/nubs-random-name-generator)

PHPackages © 2026

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