TABLE OF CONTENTS
- 1. UUIDs/UUIDs.V8
- 1.1. UUIDs.V8/V8.UUID8
UUIDs/UUIDs.V8 [ Packages ]
[ Top ] [ UUIDs ] [ Packages ]
DESCRIPTION
UUIDv8 as described in RFC-9562 5.8: https://www.ietf.org/rfc/rfc9562.html#section-5.8
SOURCE
package UUIDs.V8 is
UUIDs.V8/V8.UUID8 [ Subprograms ]
[ Top ] [ UUIDs.V8 ] [ Subprograms ]
SOURCE
function UUID8 (From : UUID_Field) return UUID; function UUID8 (From : Ada.Streams.Stream_Element_Array) return UUID with Pre => From'Size = UUID_Field'Size; function UUID8 (From : UUID_String) return UUID with Pre => From in UUID_String;
PARAMETERS
From - Either a UUIDs.UUID_Field, Stream_Element_Array, or String of the raw octets comprising of the UUID.
RETURN VALUE
UUIDs.UUID - The resulting UUIDv8 generated by the function.
EXAMPLE
-- -- Take string of octets and return UUIDv8 UUID. -- My_UUID : UUID := V8.UUID8 ("DEADBEEF-DEAF-DEED-FEED-C0FFEEABCDEF"); -- -- This will print "DEADBEEF-DEAF-8EED-BEED-C0FFEEABCDEF" -- Put_Line (My_UUID'Image);
SEE ALSO
Please see RFC-9562 5.8 for a full description: https://www.ietf.org/rfc/rfc9562.html#section-5.8
NOTES
If you would like to create a UUID with complete control of the field, please see: * UUIDs.From_String * UUIDs.From_Field * UUIDs.UUIDs.From_Stream_Element_Array
FUNCTION
UUIDv8 is meant for experimental or vendor-specific use cases. The only requirement is that variant and version must be set, thus if you initate a UUIDv8 via the UUID8 function, then any data on bits 48 through 51 of octet 6 and bits 52 through 63 (octets 6-7) will be overwritten with the variant and version respectively. This still leaves 122 bits for implementation-specific UUIDs