Fix strange unicode encoding bug

This commit is contained in:
Chris Sulmone 2018-01-17 03:00:10 -06:00
parent babb9c0c70
commit e40b3123e8
1 changed files with 2 additions and 0 deletions

View File

@ -326,6 +326,8 @@ def ser_uint256(u):
return rs
def sha256(x):
if isinstance(x, str):
x = x.encode('utf8')
return bytes(hashlib.sha256(x).digest())
def Hash(x):