Uuid
in package
FinalYes
A static helper class that implements the logic for generating UUID 4 based on RFC 4122.
Table of Contents
Constants
- NIL = '00000000-0000-0000-0000-000000000000'
- The nil UUID is a special form of UUID that is specified to have all 128 bits set to zero
Methods
- nil() : string
- v4() : non-empty-string
- Returns an RFC 4122 variant Uuid, created from the provided bytes and version.
- bytes() : string
- variant() : int
- Applies the RFC 4122 variant field to the 16-bit clock sequence.
- version() : int
- Applies the RFC 4122 version number to the 16-bit `time_hi_and_version` field.
Constants
NIL
The nil UUID is a special form of UUID that is specified to have all 128 bits set to zero
public
mixed
NIL
= '00000000-0000-0000-0000-000000000000'
Tags
Methods
nil()
public
static nil() : string
Return values
stringv4()
Returns an RFC 4122 variant Uuid, created from the provided bytes and version.
public
static v4() : non-empty-string
Tags
Return values
non-empty-stringbytes()
private
static bytes() : string
Tags
Return values
stringvariant()
Applies the RFC 4122 variant field to the 16-bit clock sequence.
private
static variant(int $clockSeq) : int
Parameters
- $clockSeq : int
Tags
Return values
intversion()
Applies the RFC 4122 version number to the 16-bit `time_hi_and_version` field.
private
static version(int $timeHi, int $version) : int
Parameters
- $timeHi : int
- $version : int