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).

Maintainers

Details

gitlab.com/xaevik/php-cuid2

This package has no released version yet, and little information is available.


README

GitHub Quality Gate Status Coverage TypeCoverage Security Rating

Packagist Version (including pre-releases) Packagist PHP Version Support

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