UuidFactoryInterface
in
UuidFactoryInterface defines common functionality all `UuidFactory` instances must implement
Table of Contents
- fromBytes() : UuidInterface
- Creates a UUID from a byte string.
- fromInteger() : UuidInterface
- Creates a `Uuid` from an integer representation
- fromString() : UuidInterface
- Creates a UUID from the string standard representation
- uuid1() : UuidInterface
- Generate a version 1 UUID from a host ID, sequence number, and the current time.
- uuid3() : UuidInterface
- Generate a version 3 UUID based on the MD5 hash of a namespace identifier (which is a UUID) and a name (which is a string).
- uuid4() : UuidInterface
- Generate a version 4 (random) UUID.
- uuid5() : UuidInterface
- Generate a version 5 UUID based on the SHA-1 hash of a namespace identifier (which is a UUID) and a name (which is a string).
Methods
fromBytes()
Creates a UUID from a byte string.
public
fromBytes(string $bytes) : UuidInterface
Parameters
- $bytes : string
-
A 16-byte string representation of a UUID
Tags
Return values
UuidInterface —fromInteger()
Creates a `Uuid` from an integer representation
public
fromInteger(mixed $integer) : UuidInterface
The integer representation may be a real integer, a string integer, or an integer representation supported by a configured number converter.
Parameters
- $integer : mixed
-
The integer to use when creating a
Uuidfrom an integer; may be of any type understood by the configured number converter
Tags
Return values
UuidInterface —fromString()
Creates a UUID from the string standard representation
public
fromString(string $uuid) : UuidInterface
Parameters
- $uuid : string
-
A string representation of a UUID
Tags
Return values
UuidInterface —uuid1()
Generate a version 1 UUID from a host ID, sequence number, and the current time.
public
uuid1([int|string|null $node = null ][, int|null $clockSeq = null ]) : UuidInterface
Parameters
- $node : int|string|null = null
-
A 48-bit number representing the hardware address This number may be represented as an integer or a hexadecimal string.
- $clockSeq : int|null = null
-
A 14-bit number used to help avoid duplicates that could arise when the clock is set backwards in time or if the node ID changes.
Tags
Return values
UuidInterface —uuid3()
Generate a version 3 UUID based on the MD5 hash of a namespace identifier (which is a UUID) and a name (which is a string).
public
uuid3(string|UuidInterface $ns, string $name) : UuidInterface
Parameters
- $ns : string|UuidInterface
-
The UUID namespace in which to create the named UUID
- $name : string
-
The name to create a UUID for
Tags
Return values
UuidInterface —uuid4()
Generate a version 4 (random) UUID.
public
uuid4() : UuidInterface
Tags
Return values
UuidInterface —uuid5()
Generate a version 5 UUID based on the SHA-1 hash of a namespace identifier (which is a UUID) and a name (which is a string).
public
uuid5(string|UuidInterface $ns, string $name) : UuidInterface
Parameters
- $ns : string|UuidInterface
-
The UUID namespace in which to create the named UUID
- $name : string
-
The name to create a UUID for