◆ __construct()
◆ fromBytes()
Creates a UUID from a byte string.
- Paramètres
-
string | $bytes | A 16-byte string representation of a UUID |
- Renvoie
- UuidInterface
- Exceptions
-
InvalidUuidStringException | |
InvalidArgumentException | if string has not 16 characters |
Implémente UuidFactoryInterface.
◆ fromInteger()
Creates a Uuid
from an integer representationThe integer representation may be a real integer, a string integer, or an integer representation supported by a configured number converter.
- Paramètres
-
mixed | $integer | The integer to use when creating a Uuid from an integer; may be of any type understood by the configured number converter |
- Renvoie
- UuidInterface
- Exceptions
-
UnsatisfiedDependencyException | if Moontoast\Math\BigNumber is not present |
InvalidUuidStringException | |
Implémente UuidFactoryInterface.
Références UuidFactory\fromString().
◆ fromString()
◆ getCodec()
Returns the UUID coder-decoder used by this factory
- Renvoie
- CodecInterface
Références UuidFactory\$codec.
◆ getNodeProvider()
◆ getNumberConverter()
◆ getRandomGenerator()
◆ getTimeGenerator()
◆ getUuidBuilder()
Returns the UUID builder this factory uses when creating Uuid
instances
- Renvoie
- UuidBuilderInterface $builder
Références UuidFactory\$uuidBuilder.
◆ setCodec()
Sets the UUID coder-decoder used by this factory
- Paramètres
-
Références UuidFactory\$codec.
◆ setNumberConverter()
Sets the number converter this factory will use
- Paramètres
-
NumberConverterInterface | $converter | |
◆ setRandomGenerator()
Sets the random UUID generator this factory will use to generate version 4 UUIDs
- Paramètres
-
RandomGeneratorInterface | $generator | |
◆ setTimeGenerator()
Sets the time-based UUID generator this factory will use to generate version 1 UUIDs
- Paramètres
-
TimeGeneratorInterface | $generator | |
◆ setUuidBuilder()
Sets the UUID builder this factory will use when creating Uuid
instances
- Paramètres
-
UuidBuilderInterface | $builder | |
◆ uuid()
Returns a Uuid
Uses the configured builder and codec and the provided array of hexadecimal value UUID fields to construct a Uuid
object.
- Paramètres
-
array | $fields | An array of fields from which to construct a UUID; see { |
- Voir également
- ::getFieldsHex()} for array structure.
- Renvoie
- UuidInterface
Références $fields.
Référencé par UuidFactory\uuidFromHashedName().
◆ uuid1()
uuid1 |
( |
|
$node = null , |
|
|
|
$clockSeq = null |
|
) |
| |
Generate a version 1 UUID from a host ID, sequence number, and the current time.
- Paramètres
-
int | string | null | $node | A 48-bit number representing the hardware address This number may be represented as an integer or a hexadecimal string. |
int | null | $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. |
- Renvoie
- UuidInterface
- Exceptions
-
UnsatisfiedDependencyException | if called on a 32-bit system and Moontoast\Math\BigNumber is not present |
InvalidArgumentException | |
Exception | if it was not possible to gather sufficient entropy |
Implémente UuidFactoryInterface.
Références UuidFactory\uuidFromHashedName().
◆ uuid3()
◆ uuid4()
◆ uuid5()
◆ uuidFromHashedName()
uuidFromHashedName |
( |
|
$hash, |
|
|
|
$version |
|
) |
| |
|
protected |
Returns a Uuid
created from $hash
with the version field set to $version
and the variant field set for RFC 4122
- Paramètres
-
string | $hash | The hash to use when creating the UUID |
int | $version | The UUID version to set for this hash (1, 3, 4, or 5) |
- Renvoie
- UuidInterface
Références $fields, $hash, $version, BinaryUtils\applyVariant(), BinaryUtils\applyVersion(), et UuidFactory\uuid().
Référencé par UuidFactory\uuid1(), UuidFactory\uuid4(), et UuidFactory\uuidFromNsAndName().
◆ uuidFromNsAndName()
uuidFromNsAndName |
( |
|
$ns, |
|
|
|
$name, |
|
|
|
$version, |
|
|
|
$hashFunction |
|
) |
| |
|
protected |
◆ $codec
◆ $nodeProvider
◆ $numberConverter
◆ $randomGenerator
◆ $timeGenerator
◆ $uuidBuilder
La documentation de cette classe a été générée à partir du fichier suivant :