bytes function

Uint8List bytes(
  1. int length
)

Creates a buffer of length bytes filled with randomness.

Throws if length is negative or above 2^32 - 1.

Implementation

Uint8List bytes(int length) {
  if (length < 0 || length > 0xffffffff) {
    throw ArgumentError.value(length, 'length', 'must be 0 to 2^32 - 1');
  }
  return ffi.randomBytes(length: BigInt.from(length));
}