exposing encoding and decoding bech32

This commit is contained in:
tripathyr 2022-10-10 17:35:36 +05:30 committed by GitHub
parent 92c15c67a4
commit e9490c8b67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2873,7 +2873,7 @@
return coinjs.base58encode(bytes.concat(checksum));
}
function decodeBech32(source) {
decodeBech32 = btc_api.decodeBech32 = function (source) {
let decode = coinjs.bech32_decode(source);
if (!decode)
return null;
@ -2887,7 +2887,7 @@
}
}
function encodeBech32(hex, version, hrp) {
encodeBech32 = btc_api.encodeBech32 = function (hex, version, hrp) {
var bytes = Crypto.util.hexToBytes(hex);
bytes = coinjs.bech32_convert(bytes, 8, 5, true);
bytes.unshift(version)