v5buffer method

List<int> v5buffer(
  1. String? namespace,
  2. String? name,
  3. List<int>? buffer, {
  4. @Deprecated('use config instead. Removal in 5.0.0') Map<String, dynamic>? options,
  5. V5Options? config,
  6. int offset = 0,
})

Generates a namespace & name-based version 5 UUID into a provided buffer

By default it will generate a string based on a provided uuid namespace and place the result into the provided buffer. The buffer will also be returned.

Optionally an offset can be provided with a start position in the buffer.

The first optional argument is an options map that takes various configuration options detailed in the readme. This is going to be eventually deprecated.

The second optional argument is a V5Options object that takes the same options as the options map. This is the preferred way to pass options.

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

Example: Generate two IDs in a single buffer

var myBuffer = new List(32);
uuid.v5buffer(Uuid.NAMESPACE_URL, 'www.google.com', myBuffer);
uuid.v5buffer(Uuid.NAMESPACE_URL, 'www.google.com', myBuffer, offset: 16);

Implementation

List<int> v5buffer(
  String? namespace,
  String? name,
  List<int>? buffer, {
  @Deprecated('use config instead. Removal in 5.0.0')
  Map<String, dynamic>? options,
  V5Options? config,
  int offset = 0,
}) {
  var result = options != null
      ? v5(namespace, name, options: options)
      : v5(namespace, name, config: config);
  return UuidParsing.parse(result, buffer: buffer, offset: offset);
}