PHPackages                             dflydev/identity-generator - 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. dflydev/identity-generator

ActiveLibrary

dflydev/identity-generator
==========================

Provides a standard interface for generating unique identifiers.

v1.0.1(13y ago)4193[1 issues](https://github.com/dflydev/dflydev-identity-generator/issues)1MITPHPPHP &gt;=5.3.2

Since Jul 14Pushed 13y ago2 watchersCompare

[ Source](https://github.com/dflydev/dflydev-identity-generator)[ Packagist](https://packagist.org/packages/dflydev/identity-generator)[ Docs](https://github.com/dflydev/dflydev-identity-generator)[ RSS](/packages/dflydev-identity-generator/feed)WikiDiscussions master Synced 2mo ago

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

Identity Generator
==================

[](#identity-generator)

Provide a standard interface for generating unique identifiers.

The purpose of this library is to solve the problem of generating unique values that are "guaranteed" to be unique and are suitable to be used as an identity for objects.

Why?
----

[](#why)

While it is generally not a problem for data stores that implement sequential or auto increment ID fields natively to provide a guaranteed unique identity, there are use cases where it makes sense to randomize identity such that it is not able to be guessed as it follows no predictable pattern.

As such, most of the `GeneratorInterface` implementations provided by this library will be somewhat random in nature. This does not preclude the use of sequential `GeneratorInterface` implementations.

Mobs
----

[](#mobs)

Mobs are used to group identities. If a mob is specified, the value requested to be stored by the data store need only be unique to that mob. This allows a single data store to potentially store and manage unique identities across several namespaces.

The name 'group' can be ambiguous (and is a reserved word for potential data stores) so 'mob' was chosen based on the definition:

> any group or collection of persons or things.

The "Uniqueness Guarantee"
--------------------------

[](#the-uniqueness-guarantee)

The uniqueness guarantee is accomplished by attempting to add a generated value to a data store. The data store needs to be capable of knowing whether or not the value passed in is unique. This guarantee of uniqueness is only as strong as the given data store's ability to effectively determine uniqueness of a given value.

A data store should throw `NonUniqueIdentityException` in the case that a given value is not unique. The requested identity and mob values are available via this exception.

What About Collisions?
----------------------

[](#what-about-collisions)

The `IdentityGenerator` will make `maxRetries` attempts to store generated values into the data store. This should allow for handling a finite number of collisions gracefully.

Should `maxRetries` be exhausted, `GenerateException` is thrown. It will contain a list of `NonUniqueIdentityException` exceptions equal to the number of `maxRetries`.

Requirements
------------

[](#requirements)

- PHP 5.3+

License
-------

[](#license)

MIT, see LICENSE.

Community
---------

[](#community)

If you have questions or want to help out, join us in the #dflydev channel on irc.freenode.net.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

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

Total

2

Last Release

5047d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d6029bd16a0e8a9b97358a75b54affa6baadc1d9b0ca7eab2b6dd6c681ad7a8?d=identicon)[simensen](/maintainers/simensen)

---

Top Contributors

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

---

Tags

generatoridentitygenerationid

### Embed Badge

![Health badge](/badges/dflydev-identity-generator/health.svg)

```
[![Health](https://phpackages.com/badges/dflydev-identity-generator/health.svg)](https://phpackages.com/packages/dflydev-identity-generator)
```

###  Alternatives

[okipa/laravel-table

Generate tables from Eloquent models.

56752.8k](/packages/okipa-laravel-table)[bithost-gmbh/pdfviewhelpers

This is a TYPO3 CMS extension that provides various Fluid ViewHelpers to generate PDF documents.

45242.7k2](/packages/bithost-gmbh-pdfviewhelpers)[dragon-code/card-number

Generation and verification of card numbers using Luhn's algorithm.

6512.8k](/packages/dragon-code-card-number)[ada-u/chocoflake

64bit time based id generator

14117.3k](/packages/ada-u-chocoflake)[xeeeveee/sudoku

PHP sudoku logic library - Generate and solve sudoku puzzles

2814.1k](/packages/xeeeveee-sudoku)[okipa/laravel-form-components

Ready-to-use and customizable form components.

198.0k1](/packages/okipa-laravel-form-components)

PHPackages © 2026

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