Merge pull request #442 from atanasi/atanasi

Allow password to have non-ASCII characters
This commit is contained in:
ThomasV 2013-11-19 01:55:32 -08:00
commit 993a8acb3e
1 changed files with 3 additions and 1 deletions

View File

@ -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]