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

Function bech32_encode

bitcoin/segwit_addr.py:55–58  ·  view source on GitHub ↗

Compute a Bech32 string given HRP and data values.

(hrp, data)

Source from the content-addressed store, hash-verified

53
54
55def bech32_encode(hrp, data):
56 """Compute a Bech32 string given HRP and data values."""
57 combined = data + bech32_create_checksum(hrp, data)
58 return hrp + '1' + ''.join([CHARSET[d] for d in combined])
59
60
61def bech32_decode(bech):

Callers 1

encodeFunction · 0.85

Calls 2

bech32_create_checksumFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected