randomBytes function
Returns size cryptographically secure random bytes.
Implementation
Uint8List randomBytes(int size) {
final random = Random.secure();
return Uint8List.fromList(
List.generate(size, (index) => random.nextInt(256)),
);
}