From 27b08a8ea2f9e70b80f58e340c637e9ee2b87f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juho=20=C3=96stman?= Date: Mon, 18 Nov 2013 23:31:45 +0200 Subject: [PATCH] Allow password to have non-ASCII characters --- lib/bitcoin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/bitcoin.py b/lib/bitcoin.py index 36758f9d..3ab78978 100644 --- a/lib/bitcoin.py +++ b/lib/bitcoin.py @@ -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]