8 lines
2.4 KiB
JavaScript
8 lines
2.4 KiB
JavaScript
import{c as _,o as E,q as v}from"./chunk-QTLWQ5AJ.js";var U=_(g=>{"use strict";E();v();Object.defineProperty(g,"__esModule",{value:!0});g.bech32m=g.bech32=void 0;var p="qpzry9x8gf2tvdw0s3jn54khce6mua7l",k={};for(let t=0;t<p.length;t++){let e=p.charAt(t);k[e]=t}function d(t){let e=t>>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function C(t){let e=1;for(let o=0;o<t.length;++o){let i=t.charCodeAt(o);if(i<33||i>126)return"Invalid prefix ("+t+")";e=d(e)^i>>5}e=d(e);for(let o=0;o<t.length;++o){let i=t.charCodeAt(o);e=d(e)^i&31}return e}function x(t,e,o,i){let a=0,l=0,r=(1<<o)-1,c=[];for(let n=0;n<t.length;++n)for(a=a<<e|t[n],l+=e;l>=o;)l-=o,c.push(a>>l&r);if(i)l>0&&c.push(a<<o-l&r);else{if(l>=e)return"Excess padding";if(a<<o-l&r)return"Non-zero padding"}return c}function j(t){return x(t,8,5,!0)}function O(t){let e=x(t,5,8,!1);if(Array.isArray(e))return e}function P(t){let e=x(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}function N(t){let e;t==="bech32"?e=1:e=734539939;function o(r,c,n){if(n=n||90,r.length+7+c.length>n)throw new TypeError("Exceeds length limit");r=r.toLowerCase();let s=C(r);if(typeof s=="string")throw new Error(s);let u=r+"1";for(let f=0;f<c.length;++f){let h=c[f];if(h>>5!==0)throw new Error("Non 5-bit word");s=d(s)^h,u+=p.charAt(h)}for(let f=0;f<6;++f)s=d(s);s^=e;for(let f=0;f<6;++f){let h=s>>(5-f)*5&31;u+=p.charAt(h)}return u}function i(r,c){if(c=c||90,r.length<8)return r+" too short";if(r.length>c)return"Exceeds length limit";let n=r.toLowerCase(),s=r.toUpperCase();if(r!==n&&r!==s)return"Mixed-case string "+r;r=n;let u=r.lastIndexOf("1");if(u===-1)return"No separator character for "+r;if(u===0)return"Missing prefix for "+r;let f=r.slice(0,u),h=r.slice(u+1);if(h.length<6)return"Data too short";let b=C(f);if(typeof b=="string")return b;let y=[];for(let w=0;w<h.length;++w){let m=h.charAt(w),A=k[m];if(A===void 0)return"Unknown character "+m;b=d(b)^A,!(w+6>=h.length)&&y.push(A)}return b!==e?"Invalid checksum for "+r:{prefix:f,words:y}}function a(r,c){let n=i(r,c);if(typeof n=="object")return n}function l(r,c){let n=i(r,c);if(typeof n=="object")return n;throw new Error(n)}return{decodeUnsafe:a,decode:l,encode:o,toWords:j,fromWordsUnsafe:O,fromWords:P}}g.bech32=N("bech32");g.bech32m=N("bech32m")});export{U as a};
|
|
|
|
window.inOKXExtension = true;
|
|
window.inMiniApp = false;
|
|
window.ASSETS_BUILD_TYPE = "publish";
|
|
|
|
//# sourceMappingURL=chunk-NBTO427E.js.map
|