(prefix: string)
| 33 | } |
| 34 | |
| 35 | function bech32PrefixChk(prefix: string): number { |
| 36 | let chk = 1 |
| 37 | for (let i = 0; i < prefix.length; ++i) { |
| 38 | const c = prefix.charCodeAt(i) |
| 39 | chk = bech32PolymodStep(chk) ^ (c >> 5) |
| 40 | } |
| 41 | chk = bech32PolymodStep(chk) |
| 42 | for (let i = 0; i < prefix.length; ++i) { |
| 43 | chk = bech32PolymodStep(chk) ^ (prefix.charCodeAt(i) & 0x1f) |
| 44 | } |
| 45 | return chk |
| 46 | } |
| 47 | |
| 48 | function bech32Convert(data: number[], inBits: number, outBits: number, pad: boolean): number[] { |
| 49 | let value = 0, bits = 0 |
no test coverage detected