--- layout: site.njk title: zul.UUID ---
Parse and generate version 4 and version 7 UUIDs.
zul.UUID is a thin wrapper around a [16]u8. Its main purpose is to generate a hex-encoded version of the UUID.
bin: [16]u8
The binary representation of the UUID.
UUID.v4() UUID
Generate a version 4 (random) UUID.
UUID.v7() UUID
Generate a version 7 UUID.
UUID.random() UUID
UUID.parse(hex: []const u8) !UUID
Attempts to parse a hex-encoded UUID. Returns error.InvalidUUID is the UUID is not valid.
UUID.bin2Hex(bin: []const u8, case: Case) ![36]iu8
Hex encodes a 16 byte binary UUID.
Hex-encodes the UUID. The case parameter must be .lower or .upper and controls whether lowercase or uppercase hexadecimal is used.
This method should be preferred over the other toHex* variants.
Hex-encodes the UUID into a heap-allocated buffer. The caller must free the returned value when it is no longer in use.
Hex-encodes the UUID into buf, which must have a length equal or greater than 36.