interface TimeGeneratorInterface (View source)

TimeGeneratorInterface provides functionality to generate strings of binary data for version 1 UUIDs based on a host ID, sequence number, and the current time

Methods

string
generate(int|string $node = null, int $clockSeq = null)

Generate a version 1 UUID from a host ID, sequence number, and the current time

Details

string generate(int|string $node = null, int $clockSeq = null)

Generate a version 1 UUID from a host ID, sequence number, and the current time

Parameters

int|string $node A 48-bit number representing the hardware address This number may be represented as an integer or a hexadecimal string.
int $clockSeq 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.

Return Value

string A binary string