DrUUID RFC 4122 library for PHP
Installs: 18 989
Open Issues: 0
- php: >=5.3.0
- ext-bcmath: Supported alternative to GMP on 32-bit systems
- ext-gmp: Recommended on 32-bit installations for time-base UUIDs
- phpseclib/phpseclib: Supported alternative to GMP or BC Math on 32-bit systems (either v1.x or v2.x)
This package is auto-updated.
Last update: 2023-05-17 12:22:56 UTC
An RFC 4122 (UUID) implementation for PHP.
DrUUID's API has been designed to be as absolutely simple to use as possible. Generating a UUID is as simple as including the library and issuing a single method call:
<?php require_once "autoload.php"; use JKingWeb\DrUUID\UUID; echo UUID::mint(); ?>
DrUUID fully complies with RFC 4122, and therefore supports Version 1 (time-based), 3 (MD5-based), 4 (random) and 5 (SHA1-based) UUIDs:
<?php require_once "autoload.php"; use JKingWeb\DrUUID\UUID; echo UUID::mint(1)."\n"; echo UUID::mint(3, "some identifier", $private_namespace)."\n"; echo UUID::mint(4)."\n"; echo UUID::mint(5, "some identifier", $private_namespace)."\n";
DrUUID includes an extensive and exhaustive HTML manual. A complete break-down of features and their use is available therein.