Skip to content

Commit a2aa1ff

Browse files
committed
feature #21158 [Uid] Add microsecond precision to UUIDv7 and optimize on x64 (alamirault)
This PR was squashed before being merged into the 7.4 branch. Discussion ---------- [Uid] Add microsecond precision to UUIDv7 and optimize on x64 Fix #21143 Commits ------- a3c4299 [Uid] Add microsecond precision to UUIDv7 and optimize on x64
2 parents bc2c9c3 + a3c4299 commit a2aa1ff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/uid.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ sortable (like :ref:`ULIDs <ulid>`). It's more efficient for database indexing
120120
**UUID v7** (UNIX timestamp)
121121

122122
Generates time-ordered UUIDs based on a high-resolution Unix Epoch timestamp
123-
source (the number of milliseconds since midnight 1 Jan 1970 UTC, leap seconds excluded)
123+
source (the number of microseconds since midnight 1 Jan 1970 UTC, leap seconds excluded)
124124
(`read the UUIDv7 spec <https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis#name-uuid-version-7>`__).
125125
It's recommended to use this version over UUIDv1 and UUIDv6 because it provides
126126
better entropy (and a more strict chronological order of UUID generation)::
@@ -130,6 +130,10 @@ better entropy (and a more strict chronological order of UUID generation)::
130130
$uuid = Uuid::v7();
131131
// $uuid is an instance of Symfony\Component\Uid\UuidV7
132132

133+
.. versionadded:: 7.4
134+
135+
In Symfony 7.4, the precision was increased from milliseconds to microseconds.
136+
133137
**UUID v8** (custom)
134138

135139
Provides an RFC-compatible format intended for experimental or vendor-specific use cases

0 commit comments

Comments
 (0)