functions.php
This file is part of the ramsey/uuid library
For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
Tags
Table of Contents
- v1() : string
- Generate a version 1 UUID from a host ID, sequence number, and the current time.
- v3() : string
- 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).
- v4() : string
- Generate a version 4 (random) UUID.
- v5() : string
- 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).
Functions
v1()
Generate a version 1 UUID from a host ID, sequence number, and the current time.
v1([int|string|null $node = null ][, int|null $clockSeq = null ]) : string
Parameters
- $node : int|string|null = null
-
A 48-bit number representing the hardware address This number may be represented as an integer or a hexadecimal string.
- $clockSeq : int|null = null
-
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.
Tags
Return values
string —v3()
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).
v3(string|UuidInterface $ns, string $name) : string
Parameters
- $ns : string|UuidInterface
-
The UUID namespace in which to create the named UUID
- $name : string
-
The name to create a UUID for
Tags
Return values
string —v4()
Generate a version 4 (random) UUID.
v4() : string
Tags
Return values
string —v5()
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).
v5(string|UuidInterface $ns, string $name) : string
Parameters
- $ns : string|UuidInterface
-
The UUID namespace in which to create the named UUID
- $name : string
-
The name to create a UUID for