Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/codebasics/cool_python_apps
/ SHA256
Function
SHA256
2_bitcoin_mining/bitcoin_mining.py:4–5 ·
view source on GitHub ↗
(text)
Source
from the content-addressed store, hash-verified
2
MAX_NONCE = 100000000000
3
4
def
SHA256(text):
5
return
sha256(text.encode(
"ascii"
)).hexdigest()
6
7
def
mine(block_number, transactions, previous_hash, prefix_zeros):
8
prefix_str =
'0'
*prefix_zeros
Callers
1
mine
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected