DefaultTimeGenerator
class DefaultTimeGenerator implements TimeGeneratorInterface (View source)
DefaultTimeGenerator provides functionality to generate strings of binary data for version 1 UUIDs based on a host ID, sequence number, and the current time
Methods
Constructs a DefaultTimeGenerator
using a node provider, time converter,
and time provider
Generate a version 1 UUID from a host ID, sequence number, and the current time
Uses the node provider given when constructing this instance to get the node ID (usually a MAC address)
Details
at line 52
__construct(NodeProviderInterface $nodeProvider, TimeConverterInterface $timeConverter, TimeProviderInterface $timeProvider)
Constructs a DefaultTimeGenerator
using a node provider, time converter,
and time provider
at line 76
string
generate(int|string $node = null, int $clockSeq = null)
Generate a version 1 UUID from a host ID, sequence number, and the current time
If $node is not given, we will attempt to obtain the local hardware address. If $clockSeq is given, it is used as the sequence number; otherwise a random 14-bit sequence number is chosen.
at line 115
protected string
getValidNode(string|int $node)
Uses the node provider given when constructing this instance to get the node ID (usually a MAC address)