v5FromBytes method

String v5FromBytes(
  1. String? namespace,
  2. Uint8List? name, {
  3. V5Options? config,
})

Generates a namespace & name-based version 5 UUID from binary data

By default it will generate a string based on a provided uuid namespace and binary name data, and will return a string.

The namespace parameter is the UUID namespace (as a String). The name parameter is a Uint8List containing arbitrary binary data. This allows for generating UUIDs from raw bytes as per RFC 4122 / RFC 9562.

The optional config argument is a V5Options object that takes configuration options.

http://tools.ietf.org/html/rfc4122.html#section-4.4

Example: Generate UUID from binary data

var binaryData = Uint8List.fromList([0x01, 0x02, 0x03, 0x04]);
uuid.v5FromBytes(Namespace.url.value, binaryData);
// -> "81156b66-5dc6-5909-8842-89a96a29d3ba"

Implementation

String v5FromBytes(String? namespace, Uint8List? name, {V5Options? config}) {
  return UuidV5(goptions: goptions)
      .generateFromBytes(namespace, name, options: config);
}