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
Returns the UUID builder this factory uses when creating Uuid
instances
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
setCodec(CodecInterface $codec)
Sets the UUID coder-decoder used by this factory
at line 98
NodeProviderInterface
getNodeProvider()
Returns the system node ID provider used by this factory
at line 108
RandomGeneratorInterface
getRandomGenerator()
Returns the random UUID generator used by this factory
at line 118
TimeGeneratorInterface
getTimeGenerator()
Returns the time-based UUID generator used by this factory
at line 128
setTimeGenerator(TimeGeneratorInterface $generator)
Sets the time-based UUID generator this factory will use to generate version 1 UUIDs
at line 138
NumberConverterInterface
getNumberConverter()
Returns the number converter used by this factory
at line 148
setRandomGenerator(RandomGeneratorInterface $generator)
Sets the random UUID generator this factory will use to generate version 4 UUIDs
at line 158
setNumberConverter(NumberConverterInterface $converter)
Sets the number converter this factory will use
at line 168
UuidBuilderInterface
getUuidBuilder()
Returns the UUID builder this factory uses when creating Uuid
instances
at line 178
setUuidBuilder(UuidBuilderInterface $builder)
Sets the UUID builder this factory will use when creating Uuid
instances
at line 183
UuidInterface
fromBytes(string $bytes)
Creates a UUID from a byte string.
at line 188
UuidInterface
fromString(string $uuid)
Creates a UUID from the string standard representation
at line 194
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 202
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 210
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 215
UuidInterface
uuid4()
Generate a version 4 (random) UUID.
at line 227
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 242
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 257
protected UuidInterface
uuidFromNsAndName(string|UuidInterface $ns, string $name, int $version, string $hashFunction)
Returns a version 3 or 5 namespaced Uuid
at line 276
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