8 lines
9.1 KiB
JavaScript
8 lines
9.1 KiB
JavaScript
import{c as m,o as l,q as x}from"./chunk-QTLWQ5AJ.js";var $=m(C=>{"use strict";l();x();Object.defineProperty(C,"__esModule",{value:!0});C.crypto=void 0;C.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var S=m(h=>{"use strict";l();x();Object.defineProperty(h,"__esModule",{value:!0});h.output=h.exists=h.hash=h.bytes=h.bool=h.number=h.isBytes=void 0;function O(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}h.number=O;function P(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}h.bool=P;function N(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}h.isBytes=N;function H(t,...e){if(!N(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}h.bytes=H;function R(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");O(t.outputLen),O(t.blockLen)}h.hash=R;function X(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}h.exists=X;function K(t,e){H(t);let o=e.outputLen;if(t.length<o)throw new Error(`digestInto() expects output buffer of length at least ${o}`)}h.output=K;var Y={number:O,bool:P,bytes:H,hash:R,exists:X,output:K};h.default=Y});var D=m(n=>{"use strict";l();x();Object.defineProperty(n,"__esModule",{value:!0});n.randomBytes=n.wrapXOFConstructorWithOpts=n.wrapConstructorWithOpts=n.wrapConstructor=n.checkOpts=n.Hash=n.concatBytes=n.toBytes=n.utf8ToBytes=n.asyncLoop=n.nextTick=n.hexToBytes=n.bytesToHex=n.byteSwap32=n.byteSwapIfBE=n.byteSwap=n.isLE=n.rotl=n.rotr=n.createView=n.u32=n.u8=n.isBytes=void 0;var M=$(),V=S();function Z(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}n.isBytes=Z;var tt=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength);n.u8=tt;var et=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));n.u32=et;var st=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);n.createView=st;var nt=(t,e)=>t<<32-e|t>>>e;n.rotr=nt;var ot=(t,e)=>t<<e|t>>>32-e>>>0;n.rotl=ot;n.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;var rt=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;n.byteSwap=rt;n.byteSwapIfBE=n.isLE?t=>t:t=>(0,n.byteSwap)(t);function it(t){for(let e=0;e<t.length;e++)t[e]=(0,n.byteSwap)(t[e])}n.byteSwap32=it;var ct=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function ft(t){(0,V.bytes)(t);let e="";for(let o=0;o<t.length;o++)e+=ct[t[o]];return e}n.bytesToHex=ft;var d={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function z(t){if(t>=d._0&&t<=d._9)return t-d._0;if(t>=d._A&&t<=d._F)return t-(d._A-10);if(t>=d._a&&t<=d._f)return t-(d._a-10)}function ut(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);let e=t.length,o=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let s=new Uint8Array(o);for(let r=0,i=0;r<o;r++,i+=2){let c=z(t.charCodeAt(i)),f=z(t.charCodeAt(i+1));if(c===void 0||f===void 0){let a=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+a+'" at index '+i)}s[r]=c*16+f}return s}n.hexToBytes=ut;var at=async()=>{};n.nextTick=at;async function ht(t,e,o){let s=Date.now();for(let r=0;r<t;r++){o(r);let i=Date.now()-s;i>=0&&i<e||(await(0,n.nextTick)(),s+=i)}}n.asyncLoop=ht;function J(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}n.utf8ToBytes=J;function j(t){return typeof t=="string"&&(t=J(t)),(0,V.bytes)(t),t}n.toBytes=j;function pt(...t){let e=0;for(let s=0;s<t.length;s++){let r=t[s];(0,V.bytes)(r),e+=r.length}let o=new Uint8Array(e);for(let s=0,r=0;s<t.length;s++){let i=t[s];o.set(i,r),r+=i.length}return o}n.concatBytes=pt;var I=class{clone(){return this._cloneInto()}};n.Hash=I;var bt={}.toString;function lt(t,e){if(e!==void 0&&bt.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}n.checkOpts=lt;function xt(t){let e=s=>t().update(j(s)).digest(),o=t();return e.outputLen=o.outputLen,e.blockLen=o.blockLen,e.create=()=>t(),e}n.wrapConstructor=xt;function dt(t){let e=(s,r)=>t(r).update(j(s)).digest(),o=t({});return e.outputLen=o.outputLen,e.blockLen=o.blockLen,e.create=s=>t(s),e}n.wrapConstructorWithOpts=dt;function yt(t){let e=(s,r)=>t(r).update(j(s)).digest(),o=t({});return e.outputLen=o.outputLen,e.blockLen=o.blockLen,e.create=s=>t(s),e}n.wrapXOFConstructorWithOpts=yt;function wt(t=32){if(M.crypto&&typeof M.crypto.getRandomValues=="function")return M.crypto.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}n.randomBytes=wt});var Q=m(w=>{"use strict";l();x();Object.defineProperty(w,"__esModule",{value:!0});w.HashMD=w.Maj=w.Chi=void 0;var F=S(),E=D();function gt(t,e,o,s){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,o,s);let r=BigInt(32),i=BigInt(4294967295),c=Number(o>>r&i),f=Number(o&i),a=s?4:0,b=s?0:4;t.setUint32(e+a,c,s),t.setUint32(e+b,f,s)}var _t=(t,e,o)=>t&e^~t&o;w.Chi=_t;var Bt=(t,e,o)=>t&e^t&o^e&o;w.Maj=Bt;var v=class extends E.Hash{constructor(e,o,s,r){super(),this.blockLen=e,this.outputLen=o,this.padOffset=s,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,E.createView)(this.buffer)}update(e){(0,F.exists)(this);let{view:o,buffer:s,blockLen:r}=this;e=(0,E.toBytes)(e);let i=e.length;for(let c=0;c<i;){let f=Math.min(r-this.pos,i-c);if(f===r){let a=(0,E.createView)(e);for(;r<=i-c;c+=r)this.process(a,c);continue}s.set(e.subarray(c,c+f),this.pos),this.pos+=f,c+=f,this.pos===r&&(this.process(o,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,F.exists)(this),(0,F.output)(e,this),this.finished=!0;let{buffer:o,view:s,blockLen:r,isLE:i}=this,{pos:c}=this;o[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>r-c&&(this.process(s,0),c=0);for(let u=c;u<r;u++)o[u]=0;gt(s,r-8,BigInt(this.length*8),i),this.process(s,0);let f=(0,E.createView)(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let b=a/4,y=this.get();if(b>y.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<b;u++)f.setUint32(4*u,y[u],i)}digest(){let{buffer:e,outputLen:o}=this;this.digestInto(e);let s=e.slice(0,o);return this.destroy(),s}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:o,buffer:s,length:r,finished:i,destroyed:c,pos:f}=this;return e.length=r,e.pos=f,e.finished=i,e.destroyed=c,r%o&&e.buffer.set(s),e}};w.HashMD=v});var At=m(L=>{"use strict";l();x();Object.defineProperty(L,"__esModule",{value:!0});L.sha224=L.sha256=void 0;var W=Q(),p=D(),Lt=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),g=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),_=new Uint32Array(64),T=class extends W.HashMD{constructor(){super(64,32,8,!1),this.A=g[0]|0,this.B=g[1]|0,this.C=g[2]|0,this.D=g[3]|0,this.E=g[4]|0,this.F=g[5]|0,this.G=g[6]|0,this.H=g[7]|0}get(){let{A:e,B:o,C:s,D:r,E:i,F:c,G:f,H:a}=this;return[e,o,s,r,i,c,f,a]}set(e,o,s,r,i,c,f,a){this.A=e|0,this.B=o|0,this.C=s|0,this.D=r|0,this.E=i|0,this.F=c|0,this.G=f|0,this.H=a|0}process(e,o){for(let u=0;u<16;u++,o+=4)_[u]=e.getUint32(o,!1);for(let u=16;u<64;u++){let A=_[u-15],B=_[u-2],G=(0,p.rotr)(A,7)^(0,p.rotr)(A,18)^A>>>3,k=(0,p.rotr)(B,17)^(0,p.rotr)(B,19)^B>>>10;_[u]=k+_[u-7]+G+_[u-16]|0}let{A:s,B:r,C:i,D:c,E:f,F:a,G:b,H:y}=this;for(let u=0;u<64;u++){let A=(0,p.rotr)(f,6)^(0,p.rotr)(f,11)^(0,p.rotr)(f,25),B=y+A+(0,W.Chi)(f,a,b)+Lt[u]+_[u]|0,k=((0,p.rotr)(s,2)^(0,p.rotr)(s,13)^(0,p.rotr)(s,22))+(0,W.Maj)(s,r,i)|0;y=b,b=a,a=f,f=c+B|0,c=i,i=r,r=s,s=B+k|0}s=s+this.A|0,r=r+this.B|0,i=i+this.C|0,c=c+this.D|0,f=f+this.E|0,a=a+this.F|0,b=b+this.G|0,y=y+this.H|0,this.set(s,r,i,c,f,a,b,y)}roundClean(){_.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},q=class extends T{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}};L.sha256=(0,p.wrapConstructor)(()=>new T);L.sha224=(0,p.wrapConstructor)(()=>new q)});export{S as a,D as b,At as c};
|
|
|
|
window.inOKXExtension = true;
|
|
window.inMiniApp = false;
|
|
window.ASSETS_BUILD_TYPE = "publish";
|
|
|
|
//# sourceMappingURL=chunk-ZW5L2LBH.js.map
|