getSecureRandomHex static method
returns bytes secure random bytes as a hex string (2 chars per byte)
Implementation
static String getSecureRandomHex(int bytes) {
final random = Random.secure();
final values = List<int>.generate(bytes, (i) => random.nextInt(256));
return convert.hex.encode(values);
}