1
0

Initial segwit support (testnet only)

This commit is contained in:
ThomasV
2017-01-16 09:48:38 +01:00
parent 11377de398
commit 3a64ec0f2e
11 changed files with 341 additions and 198 deletions

View File

@@ -159,7 +159,9 @@ class Mnemonic(object):
i = self.mnemonic_decode(seed)
return i % custom_entropy == 0
def make_seed(self, num_bits=128, prefix=version.SEED_PREFIX, custom_entropy=1):
def make_seed(self, seed_type='standard', num_bits=128, custom_entropy=1):
import version
prefix = version.seed_prefix(seed_type)
# increase num_bits in order to obtain a uniform distibution for the last word
bpw = math.log(len(self.wordlist), 2)
num_bits = int(math.ceil(num_bits/bpw)) * bpw