2017 © Pedro Peláez
 

library shortuuid-php55

PHP 5.5 compatible fork of library that generates concise, unambiguous, URL-safe UUIDs

image

ondram/shortuuid-php55

PHP 5.5 compatible fork of library that generates concise, unambiguous, URL-safe UUIDs

  • Wednesday, March 9, 2016
  • by OndraM
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3,118 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 11 Forks
  • 0 Open issues
  • 3 Versions
  • 6 % Grown

The README.md

This is just PHP 5.5 compatible fork of pascaldevink/shortuuid

If you are on PHP 5.6+, use the original source., (*1)

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

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., (*3)

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

Build Status, (*5)

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:, (*6)

composer require ondram/shortuuid-php55

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

09/03 2016

dev-master

9999999-dev

PHP 5.5 compatible fork of library that generates concise, unambiguous, URL-safe UUIDs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pascal de Vink

uuid identifier guid

09/03 2016

1.0.2

1.0.2.0

PHP 5.5 compatible fork of 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