Wallogit.com
2017 © Pedro Peláez
A PHP UUID implementation
Provides a native PHP implementation of UUID creation., (*1)
This class supports version 4 (random) and version 5 (SHA-1) UUID generation algorithms. It generates the DCE 1.1 variant UUID, the most common outside of Microsoft environments., (*2)
The UUIDs generated are RFC 4122 compliant., (*3)
This class only requires PHP 4 or later, but we recommend using the latest available version of PHP as a matter of principle. It has no dependencies., (*4)
It is installable and autoloadable via Composer as [cxj/uuid] (https://packagist.org/packages/cxj/uuid)., (*5)
Alternatively, [download a release] (https://github.com/cxj/uuid/releases) or clone this repository, then require or include its autoload.php file., (*6)
This class attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request., (*7)
This class was designed to cover only the most common use cases, and to be small and lightweight. Hence, there are some features it does not provide., (*8)
In particular:, (*9)
It does not provide a version 1 (MAC address) implementation, because there is no reliable and lightweight method to obtain the MAC address from PHP. There are also criticisms of version 1 which make it less desirable., (*10)
Version 2 (DCE Security) is also not presently implemented. The need for this version appears small., (*11)
It does not provide a version 3 (MD5) implementation. MD5 has been shown to have weaknesses, and version 5 (SHA-1) is recommended for usage instead., (*12)
It is a UUID generator, so very little UUID parsing and validation is part of the code at present., (*13)
The UUID generation methods are static, so simply call them as shown below., (*14)
Pull requests are welcome!, (*15)
Requests which follow the PSR-1 and PSR-2 coding and style standards, and which have PHPUnit test coverage will get most attention., (*16)