diff --git a/PoW.py b/PoW.py index a376337..6a7ed3c 100644 --- a/PoW.py +++ b/PoW.py @@ -11,3 +11,9 @@ def check(data, proof, complexity=1, f=hashlib.sha256): else: break return b>=complexity + +def mine(data, complexity=1, f=hashlib.sha256): + for a in range(0, 1000000000): + if check(data, a, complexity, f): + return a + break