getSecureRandomHex static method
return a secure random hex string of given length
Implementation
static String getSecureRandomHex(int length) {
final random = Random.secure();
final values = List<int>.generate(length, (i) => random.nextInt(256));
return HEX.encode(values);
}