random64HexChars method

  1. @override
String random64HexChars()
override

Generates a randwom 64-length hexadecimal string.

Example:

final randomGeneratedHex = Nostr.instance.utilsService.random64HexChars();
print(randomGeneratedHex); // ...

Implementation

@override
String random64HexChars() {
  final random = Random.secure();
  final randomBytes = List<int>.generate(32, (i) => random.nextInt(256));

  return hex.encode(randomBytes);
}