(`read the UUIDv3 spec <https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis#name-uuid-version-3>`__).
60
60
This variant is useful to generate deterministic UUIDs from arbitrary strings.
61
61
It works by populating the UUID contents with the``md5`` hash of concatenating
62
62
the namespace and the name::
@@ -69,8 +69,8 @@ the namespace and the name::
69
69
// $namespace = Uuid::v4();
70
70
71
71
// $name can be any arbitrary string
72
-
// $uuid is an instance of Symfony\Component\Uid\UuidV3
73
72
$uuid = Uuid::v3($namespace, $name);
73
+
// $uuid is an instance of Symfony\Component\Uid\UuidV3
74
74
75
75
These are the default namespaces defined by the standard:
76
76
@@ -81,20 +81,20 @@ These are the default namespaces defined by the standard:
81
81
82
82
**UUID v4** (random)
83
83
84
-
Generates a random UUID (`read UUIDv4 spec <https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis#name-uuid-version-4>`__).
84
+
Generates a random UUID (`read the UUIDv4 spec <https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis#name-uuid-version-4>`__).
85
85
Because of its randomness, it ensures uniqueness across distributed systems
86
86
without the need for a central coordinating entity. It's privacy-friendly
87
87
because it doesn't contain any information about where and when it was generated::
88
88
89
89
use Symfony\Component\Uid\Uuid;
90
90
91
-
// $uuid is an instance of Symfony\Component\Uid\UuidV4
92
91
$uuid = Uuid::v4();
92
+
// $uuid is an instance of Symfony\Component\Uid\UuidV4
93
93
94
94
**UUID v5** (name-based, SHA-1)
95
95
96
96
It's the same as UUIDv3 (explained above) but it uses ``sha1`` instead of
97
-
``md5`` to hash the given namespace and name (`read UUIDv5 spec <https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis#name-uuid-version-5>`__).
97
+
``md5`` to hash the given namespace and name (`read the UUIDv5 spec <https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis#name-uuid-version-5>`__).
98
98
This makes it more secure and less prone to hash collisions.
99
99
100
100
.. _uid-uuid-v6:
@@ -103,12 +103,12 @@ This makes it more secure and less prone to hash collisions.
103
103
104
104
It rearranges the time-based fields of the UUIDv1 to make it lexicographically
105
105
sortable (like :ref:`ULIDs <ulid>`). It's more efficient for database indexing
0 commit comments