UuidFactory
class UuidFactory implements UuidFactoryInterface (View source)
Methods
Constructs a UuidFactory
for creating Ramsey\Uuid\UuidInterface
instances
Returns the UUID coder-decoder used by this factory
Returns the system node ID provider used by this factory
Returns the random UUID generator used by this factory
Returns the time-based UUID generator used by this factory
Sets the time-based UUID generator this factory will use to generate version 1 UUIDs
Returns the number converter used by this factory
Sets the random UUID generator this factory will use to generate version 4 UUIDs
Sets the number converter this factory will use
Sets the UUID builder this factory will use when creating Uuid
instances
Creates a UUID from a byte string.
Creates a UUID from the string standard representation
Creates a Uuid
from an integer representation
Generate a version 1 UUID from a host ID, sequence number, and the current time.
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).
Generate a version 4 (random) UUID.
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).
Returns a Uuid
Returns a version 3 or 5 namespaced Uuid
Returns a Uuid
created from $hash
with the version field set to $version
and the variant field set for RFC 4122
Details
at line 61
__construct(FeatureSet $features = null)
Constructs a UuidFactory
for creating Ramsey\Uuid\UuidInterface
instances
at line 78
CodecInterface
getCodec()
Returns the UUID coder-decoder used by this factory
at line 88
NodeProviderInterface
getNodeProvider()
Returns the system node ID provider used by this factory
at line 98
RandomGeneratorInterface
getRandomGenerator()
Returns the random UUID generator used by this factory
at line 108
TimeGeneratorInterface
getTimeGenerator()
Returns the time-based UUID generator used by this factory
at line 118
setTimeGenerator(TimeGeneratorInterface $generator)
Sets the time-based UUID generator this factory will use to generate version 1 UUIDs
at line 128
NumberConverterInterface
getNumberConverter()
Returns the number converter used by this factory
at line 138
setRandomGenerator(RandomGeneratorInterface $generator)
Sets the random UUID generator this factory will use to generate version 4 UUIDs
at line 148
setNumberConverter(NumberConverterInterface $converter)
Sets the number converter this factory will use
at line 158
setUuidBuilder(UuidBuilderInterface $builder)
Sets the UUID builder this factory will use when creating Uuid
instances
at line 163
UuidInterface
fromBytes(string $bytes)
Creates a UUID from a byte string.
at line 168
UuidInterface
fromString(string $uuid)
Creates a UUID from the string standard representation
at line 173
UuidInterface
fromInteger(mixed $integer)
Creates a Uuid
from an integer representation
The integer representation may be a real integer, a string integer, or an integer representation supported by a configured number converter.
at line 181
UuidInterface
uuid1(int|string $node = null, int $clockSeq = null)
Generate a version 1 UUID from a host ID, sequence number, and the current time.
at line 189
UuidInterface
uuid3(string $ns, string $name)
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).
at line 194
UuidInterface
uuid4()
Generate a version 4 (random) UUID.
at line 206
UuidInterface
uuid5(string $ns, string $name)
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).
at line 221
UuidInterface
uuid(array $fields)
Returns a Uuid
Uses the configured builder and codec and the provided array of hexadecimal
value UUID fields to construct a Uuid
object.
at line 236
protected UuidInterface
uuidFromNsAndName(string|UuidInterface $ns, string $name, int $version, string $hashFunction)
Returns a version 3 or 5 namespaced Uuid
at line 255
protected UuidInterface
uuidFromHashedName(string $hash, int $version)
Returns a Uuid
created from $hash
with the version field set to $version
and the variant field set for RFC 4122