randomByte method

String randomByte(
  1. int size
)

Return a random byte of the given size

Implementation

String randomByte(int size) {
  var random = Random.secure();
  return HEX.encode(
      List<int>.generate(size, (i) => random.nextInt(256)).toUint8List());
}