fkulakov/uuid

Generate a UUID according to the RFC 4122 standard. Only support for version 5 UUID are built-in.

Installs: 8

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/fkulakov/uuid

dev-master 2018-06-06 15:40 UTC

This package is not auto-updated.

Last update: 2025-10-17 05:26:27 UTC


README

Total Downloads codecov Build Status Code Quality

Class to generate a universally unique identifier (UUID) according to the RFC 4122 standard. Only support for version 5 UUIDs are built-in.

Installation

composer require fkulakov/uuid dev-master

Usage

For a repeatable generate a UUID from some $source string use source() method:

Uuid::source($source)->generate();

For unrepeatable generate a random UUID use random() method:

Uuid::random()->generate();

For change namespace use setNamespace() method:

Uuid::random()->setNamespace($namespace)->generate(); 
Uuid::source($source)->setNamespace($namespace)->generate(); 
Uuid::random()->setNamespace($namespace)->generate(); 

NAMESPACE_DNS is used by default.

Notes

The UUID specification: http://tools.ietf.org/html/rfc4122.