encode method

  1. @override
Mnemonic encode(
  1. List<int> entropyBytes
)
override

Encodes the provided entropy bytes into a Monero mnemonic with a checksum.

This method encodes the given entropy bytes into a Monero mnemonic and includes a checksum word for enhanced error detection and correction.

entropyBytes: The entropy bytes to encode.

Implementation

@override
Mnemonic encode(List<int> entropyBytes) {
  List<String> words = _encodeToList(entropyBytes);
  String checksumWord = MoneroMnemonicUtils.computeChecksum(words, language);

  return Mnemonic.fromList([...words, checksumWord]);
}