fillBytesWithSecureRandom function

void fillBytesWithSecureRandom(
  1. Uint8List bytes, {
  2. Random? random,
})

Fills a list with random bytes (using Random.secure).

Implementation

void fillBytesWithSecureRandom(Uint8List bytes, {Random? random}) {
  random ??= _defaultSecureRandom;
  for (var i = 0; i < bytes.length; i++) {
    bytes[i] = random.nextInt(256);
  }
}