randomBytes function

Uint8List randomBytes(
  1. int length
)

length bytes from a cryptographically secure random source.

Implementation

Uint8List randomBytes(int length) => Uint8List.fromList(
  List.generate(length, (_) => _secureRandom.nextInt(256)),
);