Nonce.generate constructor

Nonce.generate()

Implementation

factory Nonce.generate() {
  final values = [0, 0, 0, 0, 0, 0, 0, 0];
  // First byte must be non-zero
  values[0] = _random.nextInt(0xFF) + 1;
  for (var index = 1; index < 8; ++index) {
    values[index] = _random.nextInt(0x100);
  }
  return Nonce(values);
}