Skip to content

Commit 5908acf

Browse files
committed
[Uuid] 17258 Add documentation for Uuid 7 and 8
1 parent 6e6bef4 commit 5908acf

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

components/uid.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@ to create each type of UUID::
6363
// It's defined in http://gh.peabody.io/uuidv6/
6464
$uuid = Uuid::v6(); // $uuid is an instance of Symfony\Component\Uid\UuidV6
6565

66+
// UUID version 7 features a time-ordered value field derived from the widely implemented and well known Unix Epoch timestamp source,
67+
// the number of milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded.
68+
// As well as improved entropy characteristics over versions 1 or 6.
69+
$uuid = Uuid::v7();
70+
71+
// UUID version 8 provides an RFC-compatible format for experimental or vendor-specific use cases.
72+
// The only requirement is that the variant and version bits
73+
// MUST be set as defined in Section 4: https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html#variant_and_version_fields
74+
// UUIDv8's uniqueness will be implementation-specific and SHOULD NOT be assumed.
75+
$uuid = Uuid::v8();
76+
6677
If your UUID value is already generated in another format, use any of the
6778
following methods to create a ``Uuid`` object from it::
6879

reference/constraints/Uuid.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ will allow alternate input formats like:
112112
``versions``
113113
~~~~~~~~~~~~
114114

115-
**type**: ``int[]`` **default**: ``[1,2,3,4,5,6]``
115+
**type**: ``int[]`` **default**: ``[1,2,3,4,5,6,7,8]``
116116

117-
This option can be used to only allow specific `UUID versions`_. Valid versions are 1 - 6.
117+
This option can be used to only allow specific `UUID versions`_. Valid versions are 1 - 8.
118118
The following PHP constants can also be used:
119119

120120
* ``Uuid::V1_MAC``
@@ -123,8 +123,10 @@ The following PHP constants can also be used:
123123
* ``Uuid::V4_RANDOM``
124124
* ``Uuid::V5_SHA1``
125125
* ``Uuid::V6_SORTABLE``
126+
* ``Uuid::V7_SORTABLE ``
127+
* ``Uuid::V8_CUSTOM ``
126128
127-
All six versions are allowed by default.
129+
All versions are allowed by default.
128130
129131
.. _`Universally unique identifier (UUID)`: https://en.wikipedia.org/wiki/Universally_unique_identifier
130132
.. _`RFC 4122`: https://tools.ietf.org/html/rfc4122

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy