class Uuid
Defined at line 41 of file ../../src/lib/uuid/uuid.h
A Universally Unique Identifier (UUID) or, equivalently, a Globally Unique
Identifier (GUID) is a 128-bit identifier. UUIDs can be independently
generated while having strong guarantees that no two generated UUIDs will
have the same value.
The format and algorithm for generating UUID is described in RFC 4122.
Public Methods
void Uuid ()
Generate the empty UUID ("00000000-0000-0000-0000-000000000000").
Defined at line 44 of file ../../src/lib/uuid/uuid.h
void Uuid (const uint8_t * buffer)
Generate a UUID from the given 16-byte array.
We assume that the buffer is stored in host-native endian order.
Defined at line 49 of file ../../src/lib/uuid/uuid.h
void Uuid (RawUuid raw)
Generate a UUID from a RawUuid.
Defined at line 52 of file ../../src/lib/uuid/uuid.h
Uuid Generate ()
Generate a new v4 UUID.
This method generates a version 4 (random) UUID, using 122 bits of entropy
provided by the kernel. The algorithm is described in RFC 4122,
section 4.4.
Defined at line 60 of file ../../src/lib/uuid/uuid.cc
void Uuid (uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6, uint8_t b7, uint8_t b8, uint8_t b9, uint8_t b10, uint8_t b11, uint8_t b12, uint8_t b13, uint8_t b14, uint8_t b15)
Generate a UUID from the given 16 bytes.
This constructor can be used to generate compile-time constant UUIDs:
constexpr Uuid kMyUuid = {0x01, 0x02, 0x03, 0x04, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F};
The input bytes are assumed to be in host-native endian format.
Defined at line 62 of file ../../src/lib/uuid/uuid.h
std::optional<Uuid> FromString (std::string_view uuid)
Parse a UUID of the format returned by ToString.
Returns std::nullopt if the string was invalid.
Defined at line 79 of file ../../src/lib/uuid/uuid.cc
const uint8_t * bytes ()
Raw bytes of the UUID, in host-endian format.
Defined at line 86 of file ../../src/lib/uuid/uuid.h
const RawUuid & raw ()
Raw fields of the UUID.
Defined at line 89 of file ../../src/lib/uuid/uuid.h
uint8_t * begin ()
Defined at line 91 of file ../../src/lib/uuid/uuid.h
uint8_t * end ()
Defined at line 92 of file ../../src/lib/uuid/uuid.h
const uint8_t * cbegin ()
Defined at line 94 of file ../../src/lib/uuid/uuid.h
const uint8_t * cend ()
Defined at line 95 of file ../../src/lib/uuid/uuid.h
std::string ToString ()
Generate a string representation of this UUID. The returned string will
be of the form:
00112233-4455-6677-8899-aabbccddeeff
Defined at line 110 of file ../../src/lib/uuid/uuid.cc