From 2301264fdd15da108aa1c266424af14aeee61a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Sat, 2 Dec 2017 00:22:33 +0100 Subject: [PATCH] added difficulty property for ease of use --- proofow.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proofow.py b/proofow.py index 6f0e205..462ff77 100644 --- a/proofow.py +++ b/proofow.py @@ -8,7 +8,12 @@ class pow_base: def base(self): return self._base + @property + def difficulty(self): + return self._difficulty + def __init__(self, difficulty, base=None): + self._difficulty = difficulty self._base = urandom(self._bits//8) if not base else base self._target = 2 ** (self._bits - difficulty)