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

Function bech32_create_checksum

bitcoin/segwit_addr.py:48–52  ·  view source on GitHub ↗

Compute the checksum values given HRP and data.

(hrp, data)

Source from the content-addressed store, hash-verified

46
47
48def bech32_create_checksum(hrp, data):
49 """Compute the checksum values given HRP and data."""
50 values = bech32_hrp_expand(hrp) + data
51 polymod = bech32_polymod(values + [0, 0, 0, 0, 0, 0]) ^ 1
52 return [(polymod >> 5 * (5 - i)) & 31 for i in range(6)]
53
54
55def bech32_encode(hrp, data):

Callers 1

bech32_encodeFunction · 0.85

Calls 2

bech32_hrp_expandFunction · 0.85
bech32_polymodFunction · 0.85

Tested by

no test coverage detected