8000 GitHub - visus-io/php-cuid2: PHP implementation of collision-resistant ids
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

visus-io/php-cuid2

Repository files navigation

visus/cuid2

GitHub Workflow Status (with event)

Sonar Quality Gate Sonar Coverage Sonar Tests

PHP Version Packagist Downloads GitHub

A PHP implementation of collision-resistant ids. You can read more about CUIDs from the official project website.

Getting Started

You can install visus/cuid2 as a composer package:

composer require visus/cuid2

Tip

Consider installing/enabling the PHP extension GMP. If this is not an option then markrogoyski/math-php will be used as a fallback.

Quick Example

<?php
require_once 'vendor/autoload.php';

// new (default length of 24)
$cuid = new Visus\Cuid2\Cuid2();

// implicit casting
echo $cuid; // apr5hhh4ox45krsg9gycbs9k

// explicit casting
echo $cuid->toString(); // apr5hhh4ox45krsg9gycbs9k

// new (with custom length)
$cuid = new Visus\Cuid2\Cuid2(10);
echo $cuid; // pekw02xwsd

About

PHP implementation of collision-resistant ids

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages

0