Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from hashlib import sha256
- def mineBurro(block):
- nounce = 0
- h = sha256(block.getContent() + str(nounce).encode()).hexdigest()
- block.setHash(h)
- block.setNounce(nounce)
- return block
- def mineMenosBurro(block):
- nounce = 0
- while True:
- nounce += 1
- h = sha256(block.getContent() + str(nounce).encode()).hexdigest()
- if h[0] == "0" : # hash com 1 zero
- block.setHash(h)
- block.setNounce(nounce)
- return block
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement