UuidFactoryInterface defines common functionality all UuidFactory
instances must implement
◆ 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émenté dans UuidFactory.
◆ fromInteger()
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.
- 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émenté dans UuidFactory.
◆ fromString()
Creates a UUID from the string standard representation
- Paramètres
-
string | $uuid | A string representation of a UUID |
- Renvoie
- UuidInterface
- Exceptions
-
InvalidUuidStringException | |
Implémenté dans UuidFactory.
◆ 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émenté dans UuidFactory.
◆ uuid3()
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).
- Paramètres
-
string | UuidInterface | $ns | The UUID namespace in which to create the named UUID |
string | $name | The name to create a UUID for |
- Renvoie
- UuidInterface
- Exceptions
-
InvalidUuidStringException | |
Implémenté dans UuidFactory.
◆ uuid4()
Generate a version 4 (random) UUID.
- Renvoie
- UuidInterface
- Exceptions
-
UnsatisfiedDependencyException | if Moontoast\Math\BigNumber is not present |
InvalidArgumentException | |
Exception | |
Implémenté dans UuidFactory.
◆ uuid5()
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).
- Paramètres
-
string | UuidInterface | $ns | The UUID namespace in which to create the named UUID |
string | $name | The name to create a UUID for |
- Renvoie
- UuidInterface
- Exceptions
-
InvalidUuidStringException | |
Implémenté dans UuidFactory.
La documentation de cette interface a été générée à partir du fichier suivant :