generateRandom function

Uint8List generateRandom(
  1. int size
)

Implementation

Uint8List generateRandom(int size) {
  if (_randomGenerator == null) {
    _randomGenerator = FortunaRandom();
    _randomGenerator!.seed(KeyParameter(
        platform.Platform.instance.platformEntropySource().getBytes(32)));
  }

  final r = _randomGenerator!.nextBytes(size);

  return r;
}