MCPcopy Index your code
hub / github.com/petertodd/python-bitcoinlib / uint256_from_str

Function uint256_from_str

bitcoin/core/serialize.py:297–303  ·  view source on GitHub ↗

Convert bytes to uint256

(s)

Source from the content-addressed store, hash-verified

295
296
297def uint256_from_str(s):
298 """Convert bytes to uint256"""
299 r = 0
300 t = struct.unpack(b"<IIIIIIII", s[:32])
301 for i in range(8):
302 r += t[i] << (i * 32)
303 return r
304
305
306def uint256_from_compact(c):

Callers 2

CheckProofOfWorkFunction · 0.85
test_fixedMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_fixedMethod · 0.68