is_new_seed: encode utf8
authorThomasV <thomasv@gitorious>
Tue, 29 Apr 2014 17:30:31 +0000 (19:30 +0200)
committerThomasV <thomasv@gitorious>
Tue, 29 Apr 2014 17:30:31 +0000 (19:30 +0200)
lib/bitcoin.py

index e30c838..14840c0 100644 (file)
@@ -71,7 +71,7 @@ def mnemonic_to_seed(mnemonic, passphrase):
     return PBKDF2(mnemonic, 'mnemonic' + passphrase, iterations = PBKDF2_ROUNDS, macmodule = hmac, digestmodule = hashlib.sha512).read(64)
 
 from version import SEED_PREFIX
-is_new_seed = lambda x: hmac_sha_512("Seed version", x).encode('hex')[0:2].startswith(SEED_PREFIX)
+is_new_seed = lambda x: hmac_sha_512("Seed version", x.encode('utf8')).encode('hex')[0:2].startswith(SEED_PREFIX)
 
 def is_old_seed(seed):
     import mnemonic