diff --git a/components/uid.rst b/components/uid.rst index 8e78fe76da4..d464f7c3796 100644 --- a/components/uid.rst +++ b/components/uid.rst @@ -63,6 +63,22 @@ to create each type of UUID:: // It's defined in http://gh.peabody.io/uuidv6/ $uuid = Uuid::v6(); // $uuid is an instance of Symfony\Component\Uid\UuidV6 + // UUID version 7 features a time-ordered value field derived from the widely implemented and well known + // Unix Epoch timestamp source, the number of seconds since midnight 1 Jan 1970 UTC, leap seconds excluded. + // As well as improved entropy characteristics over versions 1 or 6. + $uuid = Uuid::v7(); + + // UUID version 8 provides an RFC-compatible format for experimental or vendor-specific use cases. + // The only requirement is that the variant and version bits + // 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 + // UUIDv8's uniqueness will be implementation-specific and SHOULD NOT be assumed. + $uuid = Uuid::v8(); + +.. versionadded:: 6.2 + + Versions 7 and 8 were introduced in Symfony 6.2. + If your UUID value is already generated in another format, use any of the following methods to create a ``Uuid`` object from it:: diff --git a/reference/constraints/Uuid.rst b/reference/constraints/Uuid.rst index fff97d10171..06fdbb86147 100644 --- a/reference/constraints/Uuid.rst +++ b/reference/constraints/Uuid.rst @@ -112,9 +112,9 @@ will allow alternate input formats like: ``versions`` ~~~~~~~~~~~~ -**type**: ``int[]`` **default**: ``[1,2,3,4,5,6]`` +**type**: ``int[]`` **default**: ``[1,2,3,4,5,6,7,8]`` -This option can be used to only allow specific `UUID versions`_. Valid versions are 1 - 6. +This option can be used to only allow specific `UUID versions`_. Valid versions are 1 - 8. The following PHP constants can also be used: * ``Uuid::V1_MAC`` @@ -123,8 +123,14 @@ The following PHP constants can also be used: * ``Uuid::V4_RANDOM`` * ``Uuid::V5_SHA1`` * ``Uuid::V6_SORTABLE`` +* ``Uuid::V7_MONOTONIC`` +* ``Uuid::V8_CUSTOM`` -All six versions are allowed by default. +.. versionadded:: 6.2 + + Versions 7 and 8 were introduced in Symfony 6.2. + +All versions are allowed by default. .. _`Universally unique identifier (UUID)`: https://en.wikipedia.org/wiki/Universally_unique_identifier .. _`RFC 4122`: https://tools.ietf.org/html/rfc4122
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: