algorand_mnemonic_generator

Module for Algorand mnemonic generation.

class AlgorandMnemonicGeneratorConst

Bases: object

Class container for Algorand mnemonic generator constants.

WORDS_NUM_TO_ENTROPY_LEN: Dict[AlgorandWordsNum, AlgorandEntropyBitLen] = {AlgorandWordsNum.WORDS_NUM_25: AlgorandEntropyBitLen.BIT_LEN_256}
class AlgorandMnemonicGenerator(lang: AlgorandLanguages = AlgorandLanguages.ENGLISH)

Bases: object

Algorand mnemonic generator class. It generates 25-words mnemonic in according to Algorand wallets.

m_mnemonic_encoder: AlgorandMnemonicEncoder
FromWordsNumber(words_num: Union[int, AlgorandWordsNum]) Mnemonic

Generate mnemonic with the specified words number from random entropy. There is no really need of this method, since the words number can only be 25, but it’s kept to have the same usage of Bip39/Monero mnemonic generator.

Parameters:

words_num (int or AlgorandWordsNum) – Number of words (25)

Returns:

Generated mnemonic

Return type:

Mnemonic object

Raises:

ValueError – If words number is not valid

FromEntropy(entropy_bytes: bytes) Mnemonic

Generate mnemonic from the specified entropy bytes.

Parameters:

entropy_bytes (bytes) – Entropy bytes

Returns:

Generated mnemonic

Return type:

Mnemonic object

Raises:

ValueError – If entropy byte length is not valid