8000 feature #40012 [Uid] Add RFC4122 UUID namespaces as constants (nicola… · symfony/symfony@8f16370 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8f16370

Browse files
committed
feature #40012 [Uid] Add RFC4122 UUID namespaces as constants (nicolas-grekas)
This PR was merged into the 5.3-dev branch. Discussion ---------- [Uid] Add RFC4122 UUID namespaces as constants | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Discussed with @tgalopin Will play well with #39507 Commits ------- 4e73aeb [Uid] Add RFC4122 UUID namespaces as constants
2 parents 1a78e05 + 4e73aeb commit 8f16370

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Symfony/Component/Uid/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CHANGELOG
66

77
* Add `AbstractUid::fromBinary()`, `AbstractUid::fromBase58()`, `AbstractUid::fromBase32()` and `AbstractUid::fromRfc4122()`
88
* [BC BREAK] Replace `UuidV1::getTime()`, `UuidV6::getTime()` and `Ulid::getTime()` by `UuidV1::getDateTime()`, `UuidV6::getDateTime()` and `Ulid::getDateTime()`
9+
* Add `Uuid::NAMESPACE_*` constants from RFC4122
910

1011
5.2.0
1112
-----

src/Symfony/Component/Uid/Uuid.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@
1515
* @experimental in 5.3
1616
*
1717
* @author Grégoire Pineau <lyrixx@lyrixx.info>
18+
*
19+
* @see https://tools.ietf.org/html/rfc4122#appendix-C for details about namespaces
1820
*/
1921
class Uuid extends AbstractUid
2022
{
23+
public const NAMESPACE_DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
24+
public const NAMESPACE_URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
25+
public const NAMESPACE_OID = '6ba7b812-9dad-11d1-80b4-00c04fd430c8';
26+
public const NAMESPACE_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8';
27+
2128
protected const TYPE = 0;
2229

2330
public function __construct(string $uuid)

0 commit comments

Comments
 (0)
0