PHPackages                             seyfahni/haikunator - 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. seyfahni/haikunator

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

seyfahni/haikunator
===================

Generate random words or phrases usable as IDs.

1.0.1(3y ago)0157MITPHPPHP &gt;=8.2

Since Jan 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/seyfahni/haikunator)[ Packagist](https://packagist.org/packages/seyfahni/haikunator)[ Fund](https://www.paypal.me/seyfahni)[ GitHub Sponsors](https://github.com/seyfahni)[ RSS](/packages/seyfahni-haikunator/feed)WikiDiscussions main Synced 3d ago

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

Haikunator
==========

[](#haikunator)

This project was inspired by [HaikunatorPHP](https://github.com/Atrox/haikunatorphp) and [Jitsi](https://jitsi.org/).

It allows generation of human-friendly IDs.

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

[](#installation)

```
composer require seyfahni/haikunator
```

Usage
-----

[](#usage)

As a consumer you can expect an `Haikunator` instance to be injected into your class.

To generate an id just call the `haikunate()` method:

```
use seyfahni\Haikunator\Haikunator;

/** @var Haikunator $haikunator */
$haikunator->haikunate();
```

### Creating an instance via `Haikunators`

[](#creating-an-instance-via-haikunators)

The `Haikunators` helper class contains methods for easy creation of common `Haikunator`s:

```
use seyfahni\Haikunator\Haikunators;

$atroxHaikunator = Haikunators::atroxHaikunator();
$jitsiHaikunator = Haikunators::jitsiHaikunator();
```

### Creating a `Haikunator` by hand

[](#creating-a-haikunator-by-hand)

There are multiple implementation of the `Haikunator` interface provided. Usually you want to put a combination of `WordListHaikunator`s and `CharactersHaikunator` into one `AppendingHaikunator`.

```
use seyfahni\Haikunator\AppendingHaikunator;
use seyfahni\Haikunator\CharactersHaikunator;
use seyfahni\Haikunator\ConstantHaikunator;
use seyfahni\Haikunator\MtRandIntegerGenerator;
use seyfahni\Haikunator\WordListHaikunator;

$numberGenerator = new MtRandIntegerGenerator();

# Generate IDs like my-useful-aHt
$haikunator = new AppendingHaikunator([
    new ConstantHaikunator('my'),
    new WordListHaikunator($numberGenerator, ['fancy', 'useful', 'modular']),
    new CharactersHaikunator($numberGenerator, 'Haikunator', 3),
    ], '-'
);
```

The `IntegerGenerator` interface is used by some `Haikunator` implementations so that any kind of number generation can be used via adapter implementation.

### Extension

[](#extension)

Use your own generation logic by implementing the `Haikunator` interface and using an instance of it via "creation by hand".

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

1259d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/seyfahni-haikunator/health.svg)

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

###  Alternatives

[spatie/mjml-sidecar

Compile MJML to HTML using Sidecar

1359.5k](/packages/spatie-mjml-sidecar)

PHPackages © 2026

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