A simple, ready to use, PHP 8 ready library for generating NanoIDs.
NanoID is a short, easy to select with double click, low chance of collision, easy to generate and human readable unique identifier.
Using composer
composer require ludo237/nanoid-php
The library is straightforward to use. Instantiate a new Client
object
and call the generate
method to get a new random ID. Simple as that.
use Ludo237\Nanoid\Client;
$client = new Client();
$id = $client->generate();