Обновлён PoW.py
This commit is contained in:
parent
51732f5e7d
commit
36fbd0c6c1
4
PoW.py
4
PoW.py
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user