parse static method
Parses the provided uuid into a list of byte values as a List<int>.
Can optionally be provided a buffer to write into and
a positional offset for where to start inputting into the buffer.
Returns the buffer containing the bytes. If no buffer was provided,
a new buffer is created and returned. If a buffer was provided, it
is returned (even if the uuid bytes are not placed at the beginning of
that buffer).
Throws FormatException if the UUID is invalid. Optionally you can set
validate to false to disable validation of the UUID before parsing.
Set noDashes to true when parsing a 32-character UUID without dashes.
Throws RangeError if a buffer is provided and it is too small.
It is also thrown if a non-zero offset is provided without providing
a buffer.
Implementation
static List<int> parse(
String uuid, {
List<int>? buffer,
int offset = 0,
bool validate = true,
ValidationMode validationMode = ValidationMode.strictRFC9562,
bool noDashes = false,
}) {
if (validate) {
UuidValidation.isValidOrThrow(
fromString: uuid,
validationMode: validationMode,
noDashes: noDashes,
);
}
return _parse(uuid, buffer, offset);
}