Skip to content

Commit a0efdb6

Browse files
authored
Draft -> RFC 9562 (#92)
1 parent b68702a commit a0efdb6

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# uuid-php
55

6-
A small PHP class for generating [RFC 4122][RFC 4122] version 3, 4, and 5 universally unique identifiers (UUID). Additionally supports [draft][draft] versions 6, 7, and 8.
6+
A small PHP class for generating [RFC 9562][RFC 9562] universally unique identifiers (UUID) from version 3 to version 8.
77

88
If all you want is a unique ID, you should call `uuid4()`.
99

@@ -13,7 +13,7 @@ If you're regularly generating more than thousand UUIDs per second, you might wa
1313

1414
## Minimal UUID v4 implementation
1515

16-
Credits go to [this answer][stackoverflow uuid4] on Stackoverflow for this minimal RFC 4122 compliant solution.
16+
Credits go to [this answer][stackoverflow uuid4] on Stackoverflow for this minimal RFC 9562 compliant solution.
1717
```php
1818
<?php
1919
function uuid4()
@@ -205,6 +205,5 @@ var_dump($uuid_version); // int(4)
205205

206206
14 bits dedicated to sub-second precision provide 100 nanosecond resolution. The `unix_ts_ms` and `subsec` fields guarantee the order of UUIDs generated within the same timestamp by monotonically incrementing the timer.
207207

208-
[RFC 4122]: http://tools.ietf.org/html/rfc4122
209-
[draft]: https://github.com/ietf-wg-uuidrev/rfc4122bis
208+
[RFC 9562]: https://datatracker.ietf.org/doc/rfc9562/
210209
[stackoverflow uuid4]: https://stackoverflow.com/a/15875555

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "oittaa/uuid",
33
"type": "library",
4-
"description": "A small PHP class for generating RFC 4122 version 3, 4, and 5 universally unique identifiers (UUID). Additionally supports draft versions 6, 7, and 8.",
4+
"description": "A small PHP class for generating RFC 9562 universally unique identifiers (UUID) from version 3 to version 8.",
55
"keywords": [
66
"uuid",
77
"identifier",

src/UUID.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,61 @@
55
namespace UUID;
66

77
/**
8-
* Represents a universally unique identifier (UUID), according to RFC 4122.
8+
* Represents a universally unique identifier (UUID), according to RFC 9562.
99
*
1010
* This class provides the static methods `uuid3()`, `uuid4()`, `uuid5()`,
1111
* `uuid6()`, `uuid7()`, and `uuid8()` for generating version 3, 4, 5,
12-
* 6 (draft), 7 (draft), and 8 (draft) UUIDs.
12+
* 6, 7, and 8 UUIDs.
1313
*
1414
* If all you want is a unique ID, you should call `uuid4()`.
1515
*
16-
* @link http://tools.ietf.org/html/rfc4122
17-
* @link https://github.com/ietf-wg-uuidrev/rfc4122bis
16+
* @link https://datatracker.ietf.org/doc/rfc9562/
1817
* @link http://en.wikipedia.org/wiki/Universally_unique_identifier
1918
*/
2019
class UUID
2120
{
2221
/**
2322
* When this namespace is specified, the name string is a fully-qualified domain name.
2423
* @var string
25-
* @link http://tools.ietf.org/html/rfc4122#appendix-C
24+
* @link https://www.rfc-editor.org/rfc/rfc9562.html#name-namespace-id-usage-and-allo
2625
*/
2726
public const NAMESPACE_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
2827
/**
2928
* When this namespace is specified, the name string is a URL.
3029
* @var string
31-
* @link http://tools.ietf.org/html/rfc4122#appendix-C
30+
* @link https://www.rfc-editor.org/rfc/rfc9562.html#name-namespace-id-usage-and-allo
3231
*/
3332
public const NAMESPACE_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
3433
/**
3534
* When this namespace is specified, the name string is an ISO OID.
3635
* @var string
37-
* @link http://tools.ietf.org/html/rfc4122#appendix-C
36+
* @link https://www.rfc-editor.org/rfc/rfc9562.html#name-namespace-id-usage-and-allo
3837
*/
3938
public const NAMESPACE_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8';
4039
/**
4140
* When this namespace is specified, the name string is an X.500 DN in DER or a text output format.
4241
* @var string
43-
* @link http://tools.ietf.org/html/rfc4122#appendix-C
42+
* @link https://www.rfc-editor.org/rfc/rfc9562.html#name-namespace-id-usage-and-allo
4443
*/
4544
public const NAMESPACE_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8';
4645
/**
4746
* The nil UUID is special form of UUID that is specified to have all 128 bits set to zero.
4847
* @var string
49-
* @link http://tools.ietf.org/html/rfc4122#section-4.1.7
48+
* @link https://www.rfc-editor.org/rfc/rfc9562.html#name-nil-uuid
5049
*/
5150
public const NIL = '00000000-0000-0000-0000-000000000000';
5251
/**
5352
* The Max UUID is special form of UUID that is specified to have all 128 bits set to one.
5453
* @var string
55-
* @link https://www.ietf.org/archive/id/draft-ietf-uuidrev-rfc4122bis-00.html#name-max-uuid
54+
* @link https://www.rfc-editor.org/rfc/rfc9562.html#name-max-uuid
5655
*/
5756
public const MAX = 'FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF';
5857

5958
/**
6059
* 0x01b21dd213814000 is the number of 100-ns intervals between the
6160
* UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00.
6261
* @var int
63-
* @link https://tools.ietf.org/html/rfc4122#section-4.1.4
62+
* @link https://www.rfc-editor.org/rfc/rfc9562.html#name-test-vectors
6463
*/
6564
public const TIME_OFFSET_INT = 0x01b21dd213814000;
6665

0 commit comments

Comments
 (0)