Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 127e9a2

Browse filesBrowse files
committed
feature #14893 [Uid] Mentioned the Uuid::NAMESPACE_* constants (javiereguiluz)
This PR was merged into the 5.3-dev branch. Discussion ---------- [Uid] Mentioned the Uuid::NAMESPACE_* constants Fixes #14889. Commits ------- 1b61792 [Uid] Mentioned the Uuid::NAMESPACE_* constants
2 parents 25c2b4b + 1b61792 commit 127e9a2
Copy full SHA for 127e9a2

File tree

1 file changed

+11
-0
lines changed
Filter options

1 file changed

+11
-0
lines changed

‎components/uid.rst

Copy file name to clipboardExpand all lines: components/uid.rst
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,22 @@ to create each type of UUID::
5353
$uuid = Uuid::v3($namespace, $name); // $uuid is an instance of Symfony\Component\Uid\UuidV3
5454
$uuid = Uuid::v5($namespace, $name); // $uuid is an instance of Symfony\Component\Uid\UuidV5
5555

56+
// the namespaces defined by RFC 4122 are available as constants
57+
// (see https://tools.ietf.org/html/rfc4122#appendix-C)
58+
$uuid = Uuid::v3(Uuid::NAMESPACE_DNS, $name);
59+
$uuid = Uuid::v3(Uuid::NAMESPACE_URL, $name);
60+
$uuid = Uuid::v3(Uuid::NAMESPACE_OID, $name);
61+
$uuid = Uuid::v3(Uuid::NAMESPACE_X500, $name);
62+
5663
// UUID type 6 is not part of the UUID standard. It's lexicographically sortable
5764
// (like ULIDs) and contains a 60-bit timestamp and 63 extra unique bits.
5865
// It's defined in http://gh.peabody.io/uuidv6/
5966
$uuid = Uuid::v6(); // $uuid is an instance of Symfony\Component\Uid\UuidV6
6067

68+
.. versionadded:: 5.3
69+
70+
The ``Uuid::NAMESPACE_*`` constants were introduced in Symfony 5.3.
71+
6172
If your UUID is generated by another system, use the ``fromString()`` method to
6273
create an object and make use of the utilities available for Symfony UUIDs::
6374

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.