zpywallet.mnemonic package
Subpackages
Submodules
zpywallet.mnemonic.mnemonic module
- class Mnemonic(language: str = 'english')[source]
Bases:
object- classmethod detect_language(code: str) str[source]
Scan the Mnemonic until the language becomes unambiguous.
- generate(strength: int = 128) str[source]
Create a new mnemonic using a random generated number as entropy.
As defined in BIP39, the entropy must be a multiple of 32 bits, and its size must be between 128 and 256 bits. Therefore the possible values for strength are 128, 160, 192, 224 and 256.
If not provided, the default entropy length will be set to 128 bits.
The return is a list of words that encodes the generated entropy.
- Parameters:
strength (int) – Number of bytes used as entropy
- Returns:
A randomly generated mnemonic
- Return type:
str
Module contents
- class Mnemonic(language: str = 'english')[source]
Bases:
object- classmethod detect_language(code: str) str[source]
Scan the Mnemonic until the language becomes unambiguous.
- generate(strength: int = 128) str[source]
Create a new mnemonic using a random generated number as entropy.
As defined in BIP39, the entropy must be a multiple of 32 bits, and its size must be between 128 and 256 bits. Therefore the possible values for strength are 128, 160, 192, 224 and 256.
If not provided, the default entropy length will be set to 128 bits.
The return is a list of words that encodes the generated entropy.
- Parameters:
strength (int) – Number of bytes used as entropy
- Returns:
A randomly generated mnemonic
- Return type:
str