xaevik / cuid2
This package is abandoned and no longer maintained.
The author suggests using the visus/cuid2 package instead.
A PHP library for generating collision-resistant ids (CUIDs).
This package has no released version yet, and little information is available.
README
A PHP implementation of collision-resistant ids. You can read more about CUIDs from the official project website.
Getting Started
You can install xaevik/cuid2 as a composer package:
composer require xaevik/cuid2
Quick Example
<?php
require_once 'vendor/autoload.php';
// new (default length of 24)
$cuid = new Xaevik\Cuid2\Cuid2();
// implicit casting
echo $cuid; // hw8kkckkgwkk0oo0gkw0o8sg
// explicit casting
echo $cuid->toString(); // hw8kkckkgwkk0oo0gkw0o8sg
// new (with custom length)
$cuid = new Xaevik\Cuid2\Cuid2(10);
echo $cuid; // psk8844ck4