From 0ac5fc8922ac7d4e70e2fc2bc54ad920b99cf76a Mon Sep 17 00:00:00 2001 From: Artem Date: Mon, 9 Oct 2023 20:17:21 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D0=B0=D1=8F=20=D1=84=D1=83?= =?UTF-8?q?=D0=BD=D0=BA=D1=86=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PoW.py | 6 ++++++ 1 file changed, 6 insertions(+) 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