1
0

seed prefix 01

This commit is contained in:
ThomasV
2013-10-31 09:32:22 +01:00
parent 31aaae8ed2
commit 5cb1d6afda
2 changed files with 3 additions and 3 deletions

View File

@@ -281,7 +281,7 @@ class Wallet:
# we keep only 13 words, that's approximately 139 bits of entropy
words = mnemonic.mn_encode(s)[0:13]
seed = ' '.join(words)
if mnemonic_hash(seed)[0:3] == SEED_PREFIX:
if mnemonic_hash(seed).startswith(SEED_PREFIX):
break # this removes 12 bits of entropy
nonce += 1
@@ -316,7 +316,7 @@ class Wallet:
self.seed_version = 4
self.seed = mnemonic.mn_encode(seed)
else:
assert mnemonic_hash(seed)[0:3] == SEED_PREFIX
assert mnemonic_hash(seed).startswith(SEED_PREFIX)
self.seed_version = SEED_VERSION
self.seed = seed