diff --git a/proofow.py b/proofow.py index e9d9aa2..ac20b9c 100644 --- a/proofow.py +++ b/proofow.py @@ -30,14 +30,12 @@ class pow_base: return int(hexresult, 16) < self._target def export(self): - return b64encode(str(self.difficulty).encode() - + b':' - + self.base).decode() + return str(self.difficulty) + ':' + b64encode(self.base).decode() @classmethod def load(cls, export): - difficulty, base = b64decode(export.encode()).split(b':', 1) - return cls(int(difficulty), base) + difficulty, base = export.split(':', 1) + return cls(int(difficulty), b64decode(base.encode())) class pow_hashlib_base(pow_base):