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 e14216b

Browse filesBrowse files
[Uid] Add RFC4122 UUID namespaces as consts
1 parent 1a78e05 commit e14216b
Copy full SHA for e14216b

File tree

Expand file treeCollapse file tree

2 files changed

+8
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-0
lines changed

‎src/Symfony/Component/Uid/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/Uid/CHANGELOG.md
+1Lines 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_*` consts from RFC4122
910

1011
5.2.0
1112
-----

‎src/Symfony/Component/Uid/Uuid.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Uid/Uuid.php
+7Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.