git://git.novaco.in
/
electrum-nvc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
2844151
)
Allow password to have non-ASCII characters
author
Juho Östman
<juho.ostman@kapsi.fi>
Mon, 18 Nov 2013 21:31:45 +0000 (23:31 +0200)
committer
Juho Östman
<juho.ostman@kapsi.fi>
Mon, 18 Nov 2013 21:31:45 +0000 (23:31 +0200)
lib/bitcoin.py
patch
|
blob
|
history
diff --git
a/lib/bitcoin.py
b/lib/bitcoin.py
index
36758f9
..
3ab7897
100644
(file)
--- 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]