/ksuid-php

Primary LanguagePHPMIT LicenseMIT

ksuid

This is a library for parsing and generating Cuvva IDs in the KSUID format.

Maintained by George Miller

© Cuvva Ltd - 2018

Installation

composer require cuvva/ksuid

Usage

Generating

use Cuvva\KSUID\KSUID;

require_once('vendor/autoload.php');

$id = KSUID::generate('resource');

echo("{$id}\n"); // resource_000F5wCycYNiduc6XpnXD5Xd

Parsing

use Cuvva\KSUID\KSUID;

require_once('vendor/autoload.php');

$id = KSUID::parse('resource_000F5wCycYNiduc6XpnXD5Xd');

var_dump($id);

Testing

No tests until the library has been finalised

composer install cuvva/ksuid

./vendor/bin/phpunit --testdox tests/