generateNonce function
Generates a random nonce for challenge-response.
Implementation
String generateNonce() {
final random = Random.secure();
final bytes = Uint8List.fromList(List.generate(32, (_) => random.nextInt(256)));
return bytes.map((b) => b.toRadixString(16).padLeft(2, '0')).join();
}