electrum_v2_entropy_generator
Module for Electrum v2 mnemonic entropy generation.
- class ElectrumV2EntropyBitLen(value)
Bases:
IntEnum
Enumerative for Electrum entropy bit lengths (v2).
- BIT_LEN_132 = 132
- BIT_LEN_264 = 264
- class ElectrumV2EntropyGeneratorConst
Bases:
object
Class container for Electrum entropy generator constants (v2).
- ENTROPY_BIT_LEN: List[ElectrumV2EntropyBitLen] = [<ElectrumV2EntropyBitLen.BIT_LEN_132: 132>, <ElectrumV2EntropyBitLen.BIT_LEN_264: 264>]
- class ElectrumV2EntropyGenerator(bit_len: Union[int, ElectrumV2EntropyBitLen])
Bases:
EntropyGenerator
Electrum entropy generator class (v2). It generates random entropy bytes.
- static IsValidEntropyBitLen(bit_len: int) bool
Get if the specified entropy bit length is valid.
- Parameters:
bit_len (int) – Entropy length in bits
- Returns:
True if valid, false otherwise
- Return type:
bool
- static IsValidEntropyByteLen(byte_len: int) bool
Get if the specified entropy byte length is valid.
- Parameters:
byte_len (int) – Entropy length in bytes
- Returns:
True if valid, false otherwise
- Return type:
bool
- static AreEntropyBitsEnough(entropy: Union[bytes, int]) bool
Get if the entropy bits are enough to generate a valid mnemonic.
- Parameters:
entropy (bytes or int) – Entropy
- Returns:
True if enough, false otherwise
- Return type:
bool
- m_bit_len: int