Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 122 | All time: 9,480 This week: 60 |
Version | License | PHP version | Categories | |||
abmmhasan-uuid 1.0.3 | Custom (specified... | 7 | Text processing, PHP 7 |
Description | Author | |
This class can generate unique identifiers according to RFC 4122. |
UUID (v1, v3-v5) Generator (RFC4122)
Language: PHP 7.1/+
composer require abmmhasan/uuid
/
* Get v1 UUID (Time based)
*/
\AbmmHasan\Uuid::v1();
/
* Get generated node, for further use
*/
$node = \AbmmHasan\Uuid::getNode();
/
* Pass your pre-generated node (for node specific UUID)
*/
\AbmmHasan\Uuid::v1($node);
/
* Get v4 UUID (completely random)
*/
\AbmmHasan\Uuid::v4();
/
* Get v3 or v5 UUID for 'TestString' (default X500 namespace)
*/
\AbmmHasan\Uuid::v3('TestString');
// or
\AbmmHasan\Uuid::v5('TestString');
/
* Get v3 or v5 UUID for an URL & pre-defined namespace
* You can pass X500, URL, OID, DNS (check RFC4122 #Appendix C)
*/
\AbmmHasan\Uuid::v3('abmmhasan.github.io','url');
// or
\AbmmHasan\Uuid::v5('abmmhasan.github.io','url');
/
* You can generate a random UUID & use as namespace as well
*/
\AbmmHasan\Uuid::v3('abmmhasan.github.io','fa1700dd-828c-4d1b-8e6d-a6104807da90');
// or
\AbmmHasan\Uuid::v5('abmmhasan.github.io','fa1700dd-828c-4d1b-8e6d-a6104807da90');
/
* Not supported!
*/
Having trouble? Create an issue!
Files (4) |
File | Role | Description | ||
---|---|---|---|---|
src (1 file) | ||||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.