sync method

Generates a random keypair.

Throws an AssertionError if a keypair could not be generated. Generates a random keypair.

Throws an AssertionError if a keypair could not be generated.

Implementation

// Future<Ed25519Keypair> call() => compute((_) => sync(), null);

/// {@template NaClKeypair.sync}
/// Generates a random keypair.
///
/// Throws an [AssertionError] if a keypair could not be generated.
/// {@endtemplate}
Ed25519Keypair sync() {
  return fromSeedSync(TweetNaCl.randombytes(maxSeedLength));
}