nextBytes method

  1. @override
List<int> nextBytes(
  1. int length
)
override

Generates and returns a bytes containing pseudorandom data of the specified length from the Fortuna PRNG.

Parameters:

  • length: An integer specifying the desired length of the pseudorandom data in bytes.

Implementation

@override
List<int> nextBytes(int length) {
  final out = List<int>.filled(length, 0);
  for (int i = 0; i < length; i++) {
    out[i] = nextUint8;
  }
  return out;
}