Compute the checksum values given HRP and data.
(hrp, data)
| 46 | |
| 47 | |
| 48 | def 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 | |
| 55 | def bech32_encode(hrp, data): |
no test coverage detected