diff --git a/proofow.py b/proofow.py index ac20b9c..da06fb1 100644 --- a/proofow.py +++ b/proofow.py @@ -26,7 +26,7 @@ class pow_base: raise RuntimeError('Failed to find a nonce in {} iterations!'.format(max_attempts)) def verify(self, nonce): - hexresult = self._hexdigest(self._base + str(nonce).encode()) + hexresult = self._hexdigest(self._base + str(nonce).encode('ascii')) return int(hexresult, 16) < self._target def export(self): @@ -35,7 +35,7 @@ class pow_base: @classmethod def load(cls, export): difficulty, base = export.split(':', 1) - return cls(int(difficulty), b64decode(base.encode())) + return cls(int(difficulty), b64decode(base.encode('ascii'))) class pow_hashlib_base(pow_base):