UUID.this

this(ref const scope ubyte[16] uuidData) @safe pure nothrow @nogc

Construct a UUID struct from the 16 byte representation of a UUID.

this(const ubyte[16] uuidData) @safe pure nothrow @nogc

ditto

this(T uuidData) @safe pure

Construct a UUID struct from the 16 byte representation of a UUID. Variadic constructor to allow a simpler syntax, see examples. You need to pass exactly 16 ubytes.

this(SysTime timestamp, ubyte[10] random = generateV7RandomData()) @safe pure

UUID V7 constructor

This implementation is not guaranteed to use a cryptographically secure PRNG. For more information please see: std.random.unpredictableSeed

Parameters

timestampthe timestamp part of the UUID V7
randomUUID V7 has 74 bits of random data, which rounds to 10 ubyte's. If no random data is given, random data is generated.
this(in T[] uuid)

Parse a UUID from its canonical string form. An UUID in its canonical form looks like this: 8ab3060e-2cba-4f23-b74c-b52db3bdfb46

Throws

UUIDParsingException if the input is invalid

CTFE: This function is supported in CTFE code. Note that error messages caused by a malformed UUID parsed at compile time can be cryptic, but errors are detected and reported at compile time.

Note

This is a strict parser. It only accepts the pattern above.

It doesn't support any leading or trailing characters. It only accepts characters used for hex numbers and the string must have hyphens exactly like above.

For a less strict parser, see parseUUID