8000 [Uid] Add RFC4122 UUID namespaces as constants · symfony/symfony@4e73aeb · GitHub
[go: up one dir, main page]

Skip to content

Commit 4e73aeb

Browse files
[Uid] Add RFC4122 UUID namespaces as constants
1 parent 1a78e05 commit 4e73aeb

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