An implementation of the php-uuid-interface library
An implementation of the php-uuid-interface library
The installation of this library is made via composer.
Download composer.phar
from their website.
Then add to your composer.json :
"require": {
...
"php-extended/php-uuid-object": "^2"
...
}
Then run php composer.phar update
to install this library.
The autoloading of all classes of this library is made through composer's autoloader.
This library may be used the following way :
To parse an uuid :
use PhpExtended\Uuid\Uuid;
$uuid = Uuid::parse('<put here your uuid string>');
To generate an uuid :
$v1 = Uuid::generateV1();
$v3 = Uuid::generateV3($uuidNamespace, $stringName);
$v4 = Uuid::generateV4();
$v5 = Uuid::generateV5($uuidNamespace, $stringName);
MIT (See license file).