From d27bea49ec7695b6fe2245903b9b6e9ce2895c92 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Wed, 18 Dec 2024 17:13:10 +0100 Subject: [PATCH 1/2] Add support for RFC9562 uuid versions --- libstud/uuid/uuid.hxx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/libstud/uuid/uuid.hxx b/libstud/uuid/uuid.hxx index f2df844..51c01e0 100644 --- a/libstud/uuid/uuid.hxx +++ b/libstud/uuid/uuid.hxx @@ -14,16 +14,17 @@ struct _GUID; // GUID and UUID. namespace stud { - // Universally-unique identifier (UUID), RFC4122: + // Universally-unique identifier (UUID), RFC4122 & RFC9562: // - // https://tools.ietf.org/html/rfc4122 + // https://datatracker.ietf.org/doc/html/rfc4122 + // https://datatracker.ietf.org/doc/html/rfc9562 // The UUID variant (type). Nil UUID is DCE. // enum class uuid_variant { ncs, // NCS backward compatibility. - dce, // DCE 1.1/RFC4122. + dce, // DCE 1.1/RFC4122/RFC9562. microsoft, // Microsoft backward compatibility. other // Currently reserved for possible future definition. }; @@ -32,11 +33,14 @@ namespace stud // enum class uuid_version { - time = 1, // Time-based. - security = 2, // DCE Security with embedded POSIX UIDs. - md5 = 3, // Name-based with MD5 hashing. - random = 4, // Randomly or pseudo-randomly generated. - sha1 = 5 // Name-based with SHA1 hashing. + time = 1, // Time-based. + security = 2, // DCE Security with embedded POSIX UIDs. + md5 = 3, // Name-based with MD5 hashing. + random = 4, // Randomly or pseudo-randomly generated. + sha1 = 5, // Name-based with SHA1 hashing. + reordered_time = 6, // Sortable Time-based (RFC9562) + unix_time = 7, // Privacy friendly time based (RFC9562) + custom = 8, // Custom vendor specific (RFC9562) }; class LIBSTUD_UUID_SYMEXPORT uuid_system_generator; From 70d9f8227764e50c149988b99ce56b23900a010a Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Sat, 11 Jan 2025 12:24:38 +0100 Subject: [PATCH 2/2] Update comments --- libstud/uuid/uuid.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libstud/uuid/uuid.hxx b/libstud/uuid/uuid.hxx index 51c01e0..d0407cf 100644 --- a/libstud/uuid/uuid.hxx +++ b/libstud/uuid/uuid.hxx @@ -38,9 +38,9 @@ namespace stud md5 = 3, // Name-based with MD5 hashing. random = 4, // Randomly or pseudo-randomly generated. sha1 = 5, // Name-based with SHA1 hashing. - reordered_time = 6, // Sortable Time-based (RFC9562) - unix_time = 7, // Privacy friendly time based (RFC9562) - custom = 8, // Custom vendor specific (RFC9562) + reordered_time = 6, // Sortable time-based (RFC9562) + unix_time = 7, // Unix epoch time based (RFC9562) + custom = 8, // Custom format for experimental or vendor-specific use (RFC9562) }; class LIBSTUD_UUID_SYMEXPORT uuid_system_generator;