Create short string IDs from numbers
This library enables you to create a very short string from integer numbers.
The basic usage is:
<?php
$shortid = \ByJG\Utils\ShortId::fromNumber(81717788171667188198);
// Will write: Qi0yuM2uKwJb
The base of the short id is in the map definition.
Basically, you can create your own sequence here.
The library defines four by default:
The basic usage is:
<?php
$shortid = \ByJG\Utils\ShortId::fromNumber(
81717788171667188198,
\ByJG\Utils\ShortId::$MAP_NUMBERS_FIRST
);
// Will write: G8QokCSkAmz1
composer require "byjg/shortid=4.9.*"
vendor/bin/phpunit