2017 © Pedro Peláez
 

library shortuuid

PHP 7.1+ library that generates concise, unambiguous, URL-safe UUIDs

image

pascaldevink/shortuuid

PHP 7.1+ library that generates concise, unambiguous, URL-safe UUIDs

  • Friday, July 20, 2018
  • by pascaldevink
  • Repository
  • 16 Watchers
  • 455 Stars
  • 44,614 Installations
  • PHP
  • 9 Dependents
  • 0 Suggesters
  • 18 Forks
  • 5 Open issues
  • 11 Versions
  • 11 % Grown

The README.md

shortuuid is a simple php library that generates concise, unambiguous, URL-safe UUIDs., (*1)

Often, one needs to use non-sequential IDs in places where users will see them, but the IDs must be as concise and easy to use as possible. shortuuid solves this problem by translating generated uuids to base57 using lowercase and uppercase letters and digits, and removing similar-looking characters such as l, 1, I, O and 0., (*2)

This library is a port of it's python counter-part by Stochastic Technologies: https://github.com/stochastic-technologies/shortuuid, (*3)

Installation

The preferred method of installation is via Packagist and Composer. Run the following command to install the package and add it as a requirement to your project's composer.json:, (*4)

composer require pascaldevink/shortuuid

Examples

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

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

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

use PascalDeVink\ShortUuid\ShortUuid;

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

The Versions

20/07 2018

dev-dependabot/composer/ramsey/uuid-3.8.0

dev-dependabot/composer/ramsey/uuid-3.8.0

PHP 7.1+ library that generates concise, unambiguous, URL-safe UUIDs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pascal de Vink

uuid identifier guid

16/07 2018

dev-dependabot/composer/phpunit/phpunit-7.2.7

dev-dependabot/composer/phpunit/phpunit-7.2.7

PHP 7.1+ library that generates concise, unambiguous, URL-safe UUIDs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pascal de Vink

uuid identifier guid

04/06 2018

dev-master

9999999-dev

PHP 7.1+ library that generates concise, unambiguous, URL-safe UUIDs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pascal de Vink

uuid identifier guid

25/05 2018

dev-dependabot/composer/phpunit/phpunit-7.1.5

dev-dependabot/composer/phpunit/phpunit-7.1.5

PHP 7.1+ library that generates concise, unambiguous, URL-safe UUIDs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pascal de Vink

uuid identifier guid

31/01 2018

2.0.1

2.0.1.0

PHP 7.1+ library that generates concise, unambiguous, URL-safe UUIDs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pascal de Vink

uuid identifier guid

30/01 2018

dev-dependabot/composer/ramsey/uuid-3.7.3

dev-dependabot/composer/ramsey/uuid-3.7.3

PHP 7.1+ library that generates concise, unambiguous, URL-safe UUIDs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pascal de Vink

uuid identifier guid

30/01 2018

dev-dependabot/composer/phpunit/phpunit-6.4.4

dev-dependabot/composer/phpunit/phpunit-6.4.4

PHP 7.1+ library that generates concise, unambiguous, URL-safe UUIDs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pascal de Vink

uuid identifier guid

09/10 2017

dev-php_7

dev-php_7

PHP 7.1+ library that generates concise, unambiguous, URL-safe UUIDs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pascal de Vink

uuid identifier guid

09/10 2017

2.0.0

2.0.0.0

PHP 7.1+ library that generates concise, unambiguous, URL-safe UUIDs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pascal de Vink

uuid identifier guid

03/11 2015

1.0.1

1.0.1.0

PHP 5.6+ library that generates concise, unambiguous, URL-safe UUIDs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pascal de Vink

uuid identifier guid

03/11 2015

1.0

1.0.0.0

PHP 5.6+ library that generates concise, unambiguous, URL-safe UUIDs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pascal de Vink

uuid identifier guid