2017 © Pedro Peláez
 

library rfc-4122-uuid

PHP-Class to generate valid RFC 4122 compliant Universally Unique IDentifiers (UUID) version 3, 4 and 5.

image

macx/rfc-4122-uuid

PHP-Class to generate valid RFC 4122 compliant Universally Unique IDentifiers (UUID) version 3, 4 and 5.

  • Thursday, October 30, 2014
  • by macx
  • Repository
  • 1 Watchers
  • 4 Stars
  • 577 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

RFC 4122 UUID

The following class generates VALID RFC 4122 COMPLIANT Universally Unique IDentifiers (UUID) version 3, 4 and 5., (*1)

UUIDs generated validates using OSSP UUID Tool, and output for named-based UUIDs are exactly the same. This is a pure PHP implementation., (*2)

Author: Andrew Moore posted this as a note at the PHP Manual back in 2010., (*3)

Install

If you're using Composer as a package manager for PHP, put this require directive in your composer.json and run composer install in your CLI., (*4)

{
  "require" : {
    "macx/rfc-4122-uuid" : "1.0.*"
  }
}

Or require it via command line with:, (*5)

$ composer require macx/rfc-4122-uuid 1.0.*

Generate a unique ID

To generate a ID simply copy the following code:, (*6)

include 'vendor/autoload.php';

$uuid = macx\UUID::v4();

echo 'The generated UUID is `' . $uuid . '`';

If you want to validate a ID against RFC do this:, (*7)

$givenId = 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6';

if(macx\UUID::is_valid($givenId)) {
  // do something
}

The Versions

30/10 2014

dev-master

9999999-dev https://github.com/macx/rfc-4122-uuid

PHP-Class to generate valid RFC 4122 compliant Universally Unique IDentifiers (UUID) version 3, 4 and 5.

  Sources   Download

The Requires

  • php >=5.4.0

 

php uuid rfc-4122

14/10 2014

1.0.0

1.0.0.0 https://github.com/macx/rfc-4122-uuid

PHP-Class to generate valid RFC 4122 compliant Universally Unique IDentifiers (UUID) version 3, 4 and 5.

  Sources   Download

The Requires

  • php >=5.4.0

 

php uuid rfc-4122