Новая функция.

This commit is contained in:
Artem 2023-10-09 09:52:41 +03:00
parent 7ded9f46c2
commit 7297fe9805

13
PoW.py Normal file
View File

@ -0,0 +1,13 @@
import hashlib
def check(data, proof, complexity=1, f=hashlib.sha256):
zeros="0"*complexity
hash=f(data+proof)
hashdata=hash.hexdigest()
b=0
for a in hashdata:
if a=="0":
b+=1
else:
break
return b>=complexity