Documentation

UuidFactoryInterface

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

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 Uuid from an integer; may be of any type understood by the configured number converter

Tags
throws
UnsatisfiedDependencyException

if Moontoast\Math\BigNumber is not present

throws
InvalidUuidStringException
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
throws
UnsatisfiedDependencyException

if called on a 32-bit system and Moontoast\Math\BigNumber is not present

throws
InvalidArgumentException
throws
Exception

if it was not possible to gather sufficient entropy

Return values
UuidInterface

Search results