Skip to content

Instantly share code, notes, and snippets.

@laurogripa
Last active September 10, 2018 23:40
Show Gist options
  • Save laurogripa/323102618321d904a376ce19d1f31b89 to your computer and use it in GitHub Desktop.
Save laurogripa/323102618321d904a376ce19d1f31b89 to your computer and use it in GitHub Desktop.
import hashlib
# HASH
string = "whatever"
hashlib.sha256(string.encode()).hexdigest()
# BLOCK
block = 1
nonce = 60209
string = str(block) + str(nonce) + "whatever"
block = 1
i = 0
found = 0
hashes = []
for i in range(500000):
nonce = i
string = str(block) + str(nonce) + "dude"
hash = hashlib.sha256(string.encode()).hexdigest()
if hash[:4] == '0000':
found += 1
hashes.append(hash)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment