randombytesBuf static method

Uint8List randombytesBuf(
  1. int size
)

Implementation

static Uint8List randombytesBuf(int size) {
  RangeError.checkNotNegative(size);

  final _buf = calloc<Uint8>(size);
  try {
    _randombytes.randombytes_buf(_buf, size);
    return _buf.toList(size);
  } finally {
    calloc.free(_buf);
  }
}