PHP code example of pascaldevink / shortuuid

1. Go to this page and download the library: Download pascaldevink/shortuuid library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pascaldevink / shortuuid example snippets



Ramsey\Uuid\Uuid;
use PascalDeVink\ShortUuid\ShortUuid;

$uuid = Uuid::fromString('4e52c919-513e-4562-9248-7dd612c6c1ca');
$shortUuid = new ShortUuid();
echo $shortUuid->encode($uuid); // output fpfyRTmt6XeE9ehEKZ5LwF


PascalDeVink\ShortUuid\ShortUuid;

$shortUuid = new ShortUuid();
echo $shortUuid->decode('fpfyRTmt6XeE9ehEKZ5LwF'); // outputs 4e52c919-513e-4562-9248-7dd612c6c1ca