Skip to content

Navigation Menu

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

[Uid] Mentioned the Uuid::NAMESPACE_* constants #14893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions 11 components/uid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,22 @@ to create each type of UUID::
$uuid = Uuid::v3($namespace, $name); // $uuid is an instance of Symfony\Component\Uid\UuidV3
$uuid = Uuid::v5($namespace, $name); // $uuid is an instance of Symfony\Component\Uid\UuidV5

// the namespaces defined by RFC 4122 are available as constants
// (see https://tools.ietf.org/html/rfc4122#appendix-C)
$uuid = Uuid::v3(Uuid::NAMESPACE_DNS, $name);
$uuid = Uuid::v3(Uuid::NAMESPACE_URL, $name);
$uuid = Uuid::v3(Uuid::NAMESPACE_OID, $name);
$uuid = Uuid::v3(Uuid::NAMESPACE_X500, $name);

// UUID type 6 is not part of the UUID standard. It's lexicographically sortable
// (like ULIDs) and contains a 60-bit timestamp and 63 extra unique bits.
// It's defined in http://gh.peabody.io/uuidv6/
$uuid = Uuid::v6(); // $uuid is an instance of Symfony\Component\Uid\UuidV6

.. versionadded:: 5.3

The ``Uuid::NAMESPACE_*`` constants were introduced in Symfony 5.3.

If your UUID is generated by another system, use the ``fromString()`` method to
create an object and make use of the utilities available for Symfony UUIDs::

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.