randomNonce static method

Uint8List randomNonce()

Generates a random nonce for use in a crypto box.

Implementation

static Uint8List randomNonce() {
  try {
    return askarKeyCryptoBoxRandomNonce().getValueOrException();
  } catch (e) {
    throw AskarKeyException('Failed to generate random nonce for crypto box: $e');
  }
}