MCPcopy
hub / github.com/petertodd/python-bitcoinlib / lx

Function lx

bitcoin/core/__init__.py:44–50  ·  view source on GitHub ↗

Convert a little-endian hex string to bytes Lets you write uint256's and uint160's the way the Satoshi codebase shows them.

(h)

Source from the content-addressed store, hash-verified

42 return binascii.hexlify(b).decode('utf8')
43
44def lx(h):
45 """Convert a little-endian hex string to bytes
46
47 Lets you write uint256's and uint160's the way the Satoshi codebase shows
48 them.
49 """
50 return binascii.unhexlify(h.encode('utf8'))[::-1]
51
52def b2lx(b):
53 """Convert bytes to a little-endian hex string

Callers 15

generateMethod · 0.90
generatetoaddressMethod · 0.90
getbestblockhashMethod · 0.90
getblockheaderMethod · 0.90
getblockhashMethod · 0.90
getrawmempoolMethod · 0.90
getrawtransactionMethod · 0.90
gettxoutMethod · 0.90
listunspentMethod · 0.90
sendrawtransactionMethod · 0.90
sendmanyMethod · 0.90
sendtoaddressMethod · 0.90

Calls

no outgoing calls

Tested by 9

test_serializationMethod · 0.68
test_GetHashMethod · 0.68
test_serializationMethod · 0.68
test_GetHashMethod · 0.68
test_calc_merkle_rootMethod · 0.68
load_test_vectorsFunction · 0.68
test_reprMethod · 0.68
test_strMethod · 0.68