v4buffer method

List<int> v4buffer (List<int> buffer, { Map<String, dynamic> options: null, int offset: 0 })

v4buffer() Generates a RNG version 4 UUID

By default it will generate a string based off mathRNG, and will place the result into the provided buffer. The buffer will also be returned. If you wish to have crypto-strong RNG, pass in UuidUtil.cryptoRNG.

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

The first argument is an options map that takes various configuration options detailed in the readme.

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

Implementation

List<int> v4buffer(
  List<int> buffer, {
  Map<String, dynamic> options: null,
  int offset: 0,
}) {
  var _buf = parse(v4(options: options));

  if (buffer != null) {
    buffer.setRange(offset, offset + 16, _buf);
  }

  return buffer;
}