tMerge pull request #442 from atanasi/atanasi - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 993a8acb3eea07d778fb8fb4ee1a2233f8899ff9 DIR parent 284415145c502cc106fa3f1821cb5c5ac9f6958f HTML Author: ThomasV <thomasv1@gmx.de> Date: Tue, 19 Nov 2013 01:55:32 -0800 Merge pull request #442 from atanasi/atanasi Allow password to have non-ASCII characters Diffstat: M lib/bitcoin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- DIR diff --git a/lib/bitcoin.py b/lib/bitcoin.py t@@ -53,7 +53,9 @@ def op_push(i): -Hash = lambda x: hashlib.sha256(hashlib.sha256(x).digest()).digest() +def Hash(x): + if type(x) is unicode: x=x.encode('utf-8') + return hashlib.sha256(hashlib.sha256(x).digest()).digest() hash_encode = lambda x: x[::-1].encode('hex') hash_decode = lambda x: x.decode('hex')[::-1]