PHPackages                             deable/nanoid - 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. deable/nanoid

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

deable/nanoid
=============

Simplified and secure copy of nanoid in PHP.

v1.0.0(5y ago)0981↓50%MITPHPPHP &gt;= 7.3

Since Apr 7Pushed 5y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

deable / nanoid
===============

[](#deable--nanoid)

Tiny and secure unique string ID generator for PHP.

- **Safe.** It uses cryptographically strong random APIs and guarantees a proper distribution of symbols.
- **Small.** Only one class to handle all the logic. No dependencies.
- **Compact.** It uses more symbols than UUID (A-Za-z0-9) and has the same number of unique options in just 22 symbols instead of 36.

This tool was created based on JS library [nanoid](https://github.com/ai/nanoid) as a simplified version of other ported PHP libraries [hidehalo/nanoid-php](https://github.com/hidehalo/nanoid-php) and [better/nanoid](https://github.com/Microtribute/better-nanoid).

To optimize the length of your unique IDs, use [this tool](https://zelark.github.io/nano-id-cc/) to check collision probabilities. Don't forget that this library uses as default only characters **A-Za-z0-9**.

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

[](#requirements)

This library was developed for PHP 7.3 or newer.

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

[](#installation)

The best way to install this library is using [Composer](https://getcomposer.org/):

```
$ composer require deable/nanoid
```

Usage
-----

[](#usage)

```
$id = Deable\Nanoid::generate(22);
```

Contributing
------------

[](#contributing)

This is an open source, community-driven project. If you would like to contribute, please follow the code format as used in current sources and submit a pull request.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

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

Unknown

Total

1

Last Release

1867d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

uuidnanoid

### Embed Badge

![Health badge](/badges/deable-nanoid/health.svg)

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

###  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)[pascaldevink/shortuuid

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

5951.8M15](/packages/pascaldevink-shortuuid)[keiko/uuid-shortener

A simple shortener library for RFC 4122 compatible UUIDs. Change your 36 chars long UUID into it's shorter equivalent.

150215.4k2](/packages/keiko-uuid-shortener)

PHPackages © 2026

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