Обновлён PoW.py

This commit is contained in:
Artem 2023-10-10 07:19:53 +03:00
parent 51732f5e7d
commit 36fbd0c6c1

4
PoW.py
View File

@ -1,4 +1,4 @@
import hashlib
import hashlib, sys
def check(data, proof, complexity=1, f=hashlib.sha256):
zeros="0"*complexity
@ -13,7 +13,7 @@ def check(data, proof, complexity=1, f=hashlib.sha256):
return b>=complexity
def mine(data, complexity=1, f=hashlib.sha256):
for a in range(0, 1000000000):
for a in range(0, sys.maxsize):
if check(data, a, complexity, f):
return a
break