@cap.js/widget 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/cap-floating.min.js +1 -0
- package/cap.min.js +1 -0
- package/package.json +1 -1
- package/{cap.js → src/cap.js} +2 -1
- package/wasm-hashes.min.js +1 -0
- /package/{cap-floating.js → src/cap-floating.js} +0 -0
package/README.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Please see [github.com/tiagorangel1/cap](https://github.com/tiagorangel1/cap)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{const t=(e,o,n,i)=>{o.onclick=null;const a=parseInt(o.getAttribute("data-cap-floating-offset"))||8,s=o.getAttribute("data-cap-floating-position")||"top",c=o.getBoundingClientRect();Object.assign(n.style,{display:"block",position:"fixed",zIndex:"99999"});const l=c.left+(c.width-n.offsetWidth)/2,r=Math.min(l,window.innerWidth-n.offsetWidth);n.style.top="top"===s?`${Math.max(0,c.top-n.offsetHeight-a)}px`:`${Math.min(c.bottom+a,window.innerHeight-n.offsetHeight)}px`,n.style.left=`${Math.max(r,2)}px`,n.solve(),n.addEventListener("solve",(({detail:a})=>{o.setAttribute("data-cap-token",a.token),o.setAttribute("data-cap-progress","done"),setTimeout((()=>{i.forEach((t=>{o.addEventListener("click",t),t.call(o,e)})),setTimeout((()=>{o.onclick=null,i.forEach((t=>o.removeEventListener("click",t))),o.onclick=e=>t(e,o,n,i)}),50)}),500),setTimeout((()=>{n.style.display="none"}),700)}))},e=e=>{const o=e.getAttribute("data-cap-floating");if(!o)return;const n=document.querySelector(o);if(!document.contains(n)&&!n.solve)throw new Error(`[Cap floating] Element "${o}" doesn't exist or isn't a Cap widget`);n.style.display="none";const i=[e.onclick].filter(Boolean);"function"==typeof getEventListeners&&i.push(...(getEventListeners(e).click||[]).map((t=>t.listener))),i.length&&(e.onclick=null,i.forEach((t=>e.removeEventListener("click",t)))),e.addEventListener("click",(o=>{o.stopImmediatePropagation(),o.preventDefault(),t(o,e,n,i)}))},o=t=>{e(t),t.querySelectorAll("[data-cap-floating]").forEach(e)};o(document.body),new MutationObserver((t=>t.forEach((t=>t.addedNodes.forEach((t=>{t.nodeType===Node.ELEMENT_NODE&&o(t)})))))).observe(document.body,{childList:!0,subtree:!0})})();
|
package/cap.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";!function(){let e;class t{#e="";#t=null;#r=null;#a=navigator.hardwareConcurrency||8;#s=null;async initialize(){this.#e&&URL.revokeObjectURL(this.#e);try{await((e,t=1e4)=>new Promise(((r,a)=>{const s=setTimeout((()=>{a(new Error("Initialize timeout"))}),t),i=()=>{e()?(clearTimeout(s),r()):setTimeout(i,500)};i()})))((()=>!!e)),this.#e=URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(e){throw this.error("Failed to initialize worker"),e}}async solve(){this.dispatchEvent("progress",{progress:0});try{const e="localhost"===location.hostname?"/api/":this.#t.getAttribute("cap-api-endpoint"),{challenge:t,target:r,token:a}=await(await fetch(`${e||"https://trycap.glitch.me/api/"}challenge`,{method:"POST"})).json(),s=await this.solveChallenges({challenge:t,target:r,token:a}),i=await(await fetch(`${e||"https://trycap.glitch.me/api/"}redeem`,{method:"POST",body:JSON.stringify({token:a,solutions:s}),headers:{"Content-Type":"application/json"}})).json();if(!i.success)throw new Error("Invalid solution");this.dispatchEvent("progress",{progress:100}),this.dispatchEvent("solve",{token:i.token}),this.#s=i.token,this.#t.querySelector("input[name='cap-token']")&&(this.#t.querySelector("input[name='cap-token']").value=i.token),this.#r&&clearTimeout(this.#r);const n=new Date(i.expires).getTime()-Date.now();return n>0&&n<864e5?this.#r=setTimeout((()=>this.reset()),n):this.error("Invalid expiration time"),{success:!0,token:this.#s}}catch(e){throw this.error(e.message),e}}async solveChallenges({challenge:e,target:t}){const r=e.length;let a=0;const s=Array(this.#a).fill(null).map((()=>new Worker(this.#e))),i=([e,t],i)=>new Promise(((n,o)=>{const c=s[i],d=setTimeout((()=>{c.terminate(),s[i]=new Worker(this.#e),o(new Error("Worker timeout"))}),3e4);c.onmessage=({data:s})=>{s.found&&(clearTimeout(d),a++,this.dispatchEvent("progress",{progress:Math.round(a/r*100)}),n([e,t,s.nonce]))},c.onerror=e=>{clearTimeout(d),this.error(`Error in worker: ${e}`),o(e)},c.postMessage({salt:e,target:t})})),n=[];try{for(let t=0;t<e.length;t+=this.#a){const r=e.slice(t,Math.min(t+this.#a,e.length)),a=await Promise.all(r.map(((e,t)=>i(e,t))));n.push(...a)}}finally{s.forEach((e=>e.terminate()))}return n}reset(){this.#r&&(clearTimeout(this.#r),this.#r=null),this.dispatchEvent("reset"),this.#s=null,this.#t.querySelector("input[name='cap-token']")&&(this.#t.querySelector("input[name='cap-token']").value="")}error(e="Unknown error"){console.error("[Cap] Error:",e),this.dispatchEvent("error",{isCap:!0,message:e})}dispatchEvent(e,t={}){const r=new CustomEvent(e,{bubbles:!0,composed:!0,detail:t});this.#t.dispatchEvent(r)}setElement(e){this.#t=e}setWorkersCount(e){const t=parseInt(e,10),r=Math.min(navigator.hardwareConcurrency||8,16);this.#a=!isNaN(t)&&t>0&&t<=r?t:navigator.hardwareConcurrency||8}getToken(){return this.#s}cleanup(){this.#r&&(clearTimeout(this.#r),this.#r=null),this.#e&&(URL.revokeObjectURL(this.#e),this.#e="")}}class r extends HTMLElement{#i=new t;#n;#o;#c;#d=!1;eventHandlers;static get observedAttributes(){return["onsolve","onprogress","onreset","onerror","workers"]}constructor(){super(),this.eventHandlers&&this.eventHandlers.forEach(((e,t)=>{this.removeEventListener(t.slice(2),e)})),this.eventHandlers=new Map,this.boundHandleProgress=this.handleProgress.bind(this),this.boundHandleSolve=this.handleSolve.bind(this),this.boundHandleError=this.handleError.bind(this),this.boundHandleReset=this.handleReset.bind(this)}attributeChangedCallback(e,t,r){if(e.startsWith("on")){const t=e.slice(2),a=this.eventHandlers.get(e);if(a&&this.removeEventListener(t,a),r){const r=t=>{const r=this.getAttribute(e);"function"==typeof window[r]&&window[r].call(this,t)};this.eventHandlers.set(e,r),this.addEventListener(t,r)}}}async connectedCallback(){this.#c=this,this.#n=this.attachShadow({mode:"open"}),this.#i.setElement(this),this.#o=document.createElement("div"),this.createUI(),this.addEventListeners(),await this.#i.initialize(),this.#o.removeAttribute("disabled");const e=this.getAttribute("cap-worker-count");this.#i.setWorkersCount(parseInt(e)?parseInt(e,10):navigator.hardwareConcurrency||8),this.#c.innerHTML='<input type="hidden" name="cap-token">'}createUI(){this.#o.classList.add("captcha"),this.#o.setAttribute("role","button"),this.#o.setAttribute("tabindex","0"),this.#o.setAttribute("disabled","true"),this.#o.innerHTML='<div class="checkbox"></div><p>I\'m a human</p><a href="#" class="credits" target="_blank"><span>Secured by </span>Cap</a>',this.#n.innerHTML='<style>.captcha{background-color:var(--cap-background);border:1px solid var(--cap-border-color);border-radius:var(--cap-border-radius);width:var(--cap-widget-width);display:flex;align-items:center;padding:var(--cap-widget-padding);gap:var(--cap-gap);cursor:pointer;transition:filter var(--cap-transition-duration),transform var(--cap-transition-duration);position:relative;-webkit-tap-highlight-color:rgba(255,255,255,0);overflow:hidden;color:var(--cap-color)}.captcha:hover{filter:var(--cap-hover-filter)}.captcha:not([disabled]):active{transform:scale(var(--cap-active-scale))}.checkbox{width:var(--cap-checkbox-size);height:var(--cap-checkbox-size);border:var(--cap-checkbox-border);border-radius:var(--cap-checkbox-border-radius);background-color:var(--cap-checkbox-background);transition:opacity var(--cap-transition-duration);margin-top:var(--cap-checkbox-margin);margin-bottom:var(--cap-checkbox-margin)}.captcha *{font-family:var(--cap-font)}.captcha p{margin:0;font-weight:500;font-size:15px;user-select:none;transition:opacity var(--cap-transition-duration)}.captcha[data-state=verifying] .checkbox{background: none;display:flex;align-items:center;justify-content:center;transform: scale(1.1);border: none;border-radius: 50%;background: conic-gradient(var(--cap-spinner-color) 0%, var(--cap-spinner-color) var(--progress, 0%), var(--cap-spinner-background-color) var(--progress, 0%), var(--cap-spinner-background-color) 100%);position: relative;}.captcha[data-state=verifying] .checkbox::after {content: "";background-color: var(--cap-background);width: calc(100% - var(--cap-spinner-thickness));height: calc(100% - var(--cap-spinner-thickness));border-radius: 50%;margin:calc(var(--cap-spinner-thickness) / 2)}.captcha[data-state=done] .checkbox{border:1px solid transparent;background-image:var(--cap-checkmark);background-size:cover}.captcha[data-state=error] .checkbox{border:1px solid transparent;background-image:var(--cap-error-cross);background-size:cover}.captcha[disabled]{\ncursor:not-allowed}.captcha[disabled][data-state=verifying]{cursor:progress}.captcha[disabled][data-state=done]{cursor:default}.captcha .credits{position:absolute;bottom:10px;right:10px;font-size:var(--cap-credits-font-size);color:var(--cap-color);opacity:var(--cap-opacity-hover)}.captcha .credits span{display:none;text-decoration:underline}.captcha .credits:hover span{display:inline-block}</style>',this.#n.appendChild(this.#o)}addEventListeners(){this.#o.querySelector("a").addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault(),window.open("#","_blank")})),this.#o.addEventListener("click",(()=>{this.#o.hasAttribute("disabled")||this.solve()})),this.addEventListener("progress",this.boundHandleProgress),this.addEventListener("solve",this.boundHandleSolve),this.addEventListener("error",this.boundHandleError),this.addEventListener("reset",this.boundHandleReset)}async solve(){if(!this.#d)try{this.#d=!0,this.updateUI("verifying","Verifying...",!0);return await this.#i.solve()}finally{this.#d=!1}}updateUI(e,t,r=!1){this.#o.setAttribute("data-state",e),this.#o.querySelector("p").innerText=t,r?this.#o.setAttribute("disabled","true"):this.#o.removeAttribute("disabled")}handleProgress(e){const t=this.#o.querySelector("p");t&&(this.#o.querySelector(".checkbox").style.setProperty("--progress",`${e.detail.progress}%`),t.innerText=`Verifying... ${e.detail.progress}%`),this.executeAttributeCode("onprogress",e)}handleSolve(e){this.updateUI("done","You're a human",!0),this.executeAttributeCode("onsolve",e)}handleError(e){this.updateUI("error","Error. Try again."),this.executeAttributeCode("onerror",e)}handleReset(e){this.updateUI("","I'm a human"),this.executeAttributeCode("onreset",e)}executeAttributeCode(e,t){const r=this.getAttribute(e);if(!r)return;new Function("event",r).call(this,t)}reset(){this.#i.reset()}get token(){return this.#i.getToken()}disconnectedCallback(){this.removeEventListener("progress",this.boundHandleProgress),this.removeEventListener("solve",this.boundHandleSolve),this.removeEventListener("error",this.boundHandleError),this.removeEventListener("reset",this.boundHandleReset),this.eventHandlers.forEach(((e,t)=>{this.removeEventListener(t.slice(2),e)})),this.eventHandlers.clear(),this.#n&&(this.#n.innerHTML=""),this.#i.reset(),this.#i.cleanup()}}class a{constructor(e,r={}){let a=new t,s=e||document.createElement("div");e||(s.style.display="none"),Object.entries(r).forEach((([e,t])=>{s.setAttribute(e,t)})),r.apiEndpoint&&s.setAttribute("cap-api-endpoint",r.apiEndpoint),a.setElement(s),a.setWorkersCount(r.workers||navigator.hardwareConcurrency||8),a.initialize(),this.solve=async function(){return await a.solve()},this.reset=function(){a.reset()},this.addEventListener=function(e,t){s.addEventListener(e,t)},Object.defineProperty(this,"token",{get:()=>a.getToken(),configurable:!0,enumerable:!0})}}const s=new CSSStyleSheet;s.replaceSync('html{--cap-font:system,-apple-system,"BlinkMacSystemFont",".SFNSText-Regular","San Francisco","Roboto","Segoe UI","Helvetica Neue","Lucida Grande","Ubuntu","arial",sans-serif;--cap-color:#212121;--cap-background:#fdfdfd;--cap-border-color:#dddddd8f;--cap-border-radius:14px;--cap-checkbox-border:1px solid #aaaaaad1;--cap-checkbox-border-radius:6px;--cap-checkbox-background:#fafafa91;--cap-widget-width:240px;--cap-widget-padding:14px;--cap-checkbox-size:24px;--cap-checkbox-margin:2px;--cap-transition-duration:0.2s;--cap-gap:15px;--cap-opacity-hover:0.8;--cap-hover-filter:brightness(97%);--cap-active-scale:0.98;--cap-credits-font-size:12px;--cap-spinner-color:black;--cap-spinner-background-color:#eee;--cap-error-cross:url("data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'96\' height=\'96\' viewBox=\'0 0 24 24\'%3E%3Cpath fill=\'%23f55b50\' d=\'M11 15h2v2h-2zm0-8h2v6h-2zm1-5C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 18a8 8 0 0 1-8-8a8 8 0 0 1 8-8a8 8 0 0 1 8 8a8 8 0 0 1-8 8\'/%3E%3C/svg%3E");--cap-checkmark:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cstyle%3E%40keyframes%20anim%7B0%25%7Bstroke-dashoffset%3A23.21320343017578px%7Dto%7Bstroke-dashoffset%3A0%7D%7D%3C%2Fstyle%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%2300a67d%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22m5%2012%205%205L20%207%22%20style%3D%22stroke-dashoffset%3A0%3Bstroke-dasharray%3A23.21320343017578px%3Banimation%3Aanim%20.5s%20ease%22%2F%3E%3C%2Fsvg%3E");--cap-spinner-thickness:5px;}'),document.adoptedStyleSheets.push(s);const i=function(){let e;self.onmessage=async({data:{salt:t,target:r}})=>{e||(e=await hashwasm.createSHA256());let a=0;let s=0;const i=new Uint8Array(128),n=new TextEncoder;for(;;)try{for(let s=0;s<5e4;s++){const s=t+a.toString(),o=n.encode(s);i.set(o),e.init(),e.update(i.subarray(0,o.length));if(e.digest("hex").startsWith(r))return void self.postMessage({nonce:a,found:!0});a++}s+=5e4,s>=5e5&&(self.postMessage({nonce:a,found:!1}),s=0)}catch(e){return void self.postMessage({found:!1,error:e.message})}}};setTimeout((async function(){e=await(await fetch("https://cdn.jsdelivr.net/gh/tiagorangel1/cap/lib/wasm-hashes.min.js")).text()+i.toString().replace(/^function\s*\([^\)]*\)\s*{|\}$/g,"").trim()}),1),window.Cap=a,customElements.get("cap-widget")?console.warn("The cap-widget element has already been defined. Skipping re-defining it."):customElements.define("cap-widget",r),"object"==typeof exports&&"undefined"!=typeof module?module.exports=a:"function"==typeof define&&define.amd&&define([],(function(){return a})),"undefined"!=typeof exports&&(exports.default=a)}();
|
package/package.json
CHANGED
package/{cap.js → src/cap.js}
RENAMED
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
async solve() {
|
|
48
|
+
await until(() => !!this.#workerUrl);
|
|
48
49
|
this.dispatchEvent("progress", { progress: 0 });
|
|
49
50
|
|
|
50
51
|
try {
|
|
@@ -494,7 +495,7 @@
|
|
|
494
495
|
|
|
495
496
|
setTimeout(async function () {
|
|
496
497
|
workerScript =
|
|
497
|
-
(await (await fetch("https://cdn.jsdelivr.net/
|
|
498
|
+
(await (await fetch("https://cdn.jsdelivr.net/npm/@cap.js/widget/wasm-hashes.min.js")).text()) +
|
|
498
499
|
workerFunct
|
|
499
500
|
.toString()
|
|
500
501
|
.replace(/^function\s*\([^\)]*\)\s*{|\}$/g, "")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hashwasm=e.hashwasm||{})}(void 0,(function(e){function t(e,t,n,A){return new(n||(n=Promise))((function(i,o){function r(e){try{a(A.next(e))}catch(e){o(e)}}function E(e){try{a(A.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,E)}a((A=A.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class n{constructor(){this.mutex=Promise.resolve()}lock(){let e=()=>{};return this.mutex=this.mutex.then((()=>new Promise(e))),new Promise((t=>{e=t}))}dispatch(e){return t(this,void 0,void 0,(function*(){const t=yield this.lock();try{return yield Promise.resolve(e())}finally{t()}}))}}var A;const i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,o=null!==(A=i.Buffer)&&void 0!==A?A:null,r=i.TextEncoder?new i.TextEncoder:null;function E(e,t){return(15&e)+(e>>6|e>>3&8)<<4|(15&t)+(t>>6|t>>3&8)}const a="a".charCodeAt(0)-10,g="0".charCodeAt(0);function s(e,t,n){let A=0;for(let i=0;i<n;i++){let n=t[i]>>>4;e[A++]=n>9?n+a:n+g,n=15&t[i],e[A++]=n>9?n+a:n+g}return String.fromCharCode.apply(null,e)}const C=null!==o?e=>{if("string"==typeof e){const t=o.from(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.length)}if(o.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")}:e=>{if("string"==typeof e)return r.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")},B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=new Uint8Array(256);for(let e=0;e<64;e++)c[B.charCodeAt(e)]=e;function l(e){const t=function(e){let t=Math.floor(.75*e.length);const n=e.length;return"="===e[n-1]&&(t-=1,"="===e[n-2]&&(t-=1)),t}(e),n=e.length,A=new Uint8Array(t);let i=0;for(let t=0;t<n;t+=4){const n=c[e.charCodeAt(t)],o=c[e.charCodeAt(t+1)],r=c[e.charCodeAt(t+2)],E=c[e.charCodeAt(t+3)];A[i]=n<<2|o>>4,i+=1,A[i]=(15&o)<<4|r>>2,i+=1,A[i]=(3&r)<<6|63&E,i+=1}return A}const h=16384,f=new n,d=new Map;function u(e,n){return t(this,void 0,void 0,(function*(){let A=null,i=null,o=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const r=()=>new DataView(A.exports.memory.buffer).getUint32(A.exports.STATE_SIZE,!0),a=f.dispatch((()=>t(this,void 0,void 0,(function*(){if(!d.has(e.name)){const t=l(e.data),n=WebAssembly.compile(t);d.set(e.name,n)}const t=yield d.get(e.name);A=yield WebAssembly.instantiate(t,{})})))),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;o=!0,A.exports.Hash_Init(e)},B=e=>{if(!o)throw new Error("update() called before init()");(e=>{let t=0;for(;t<e.length;){const n=e.subarray(t,t+h);t+=n.length,i.set(n),A.exports.Hash_Update(n.length)}})(C(e))},c=new Uint8Array(2*n),u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)throw new Error("digest() called before init()");return o=!1,A.exports.Hash_Final(t),"binary"===e?i.slice(0,n):s(c,i,n)},v=e=>"string"==typeof e?e.length<4096:e.byteLength<h;let N=v;switch(e.name){case"argon2":case"scrypt":N=()=>!0;break;case"blake2b":case"blake2s":N=(e,t)=>t<=512&&v(e);break;case"blake3":N=(e,t)=>0===t&&v(e);break;case"xxhash64":case"xxhash3":case"xxhash128":N=()=>!1}return yield(()=>t(this,void 0,void 0,(function*(){A||(yield a);const e=A.exports.Hash_GetBuffer(),t=A.exports.memory.buffer;i=new Uint8Array(t,e,h)})))(),{getMemory:()=>i,writeMemory:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i.set(e,t)},getExports:()=>A.exports,setMemorySize:e=>{A.exports.Hash_SetMemorySize(e);const t=A.exports.Hash_GetBuffer(),n=A.exports.memory.buffer;i=new Uint8Array(n,t,e)},init:g,update:B,digest:u,save:()=>{if(!o)throw new Error("save() can only be called after init() and before digest()");const t=A.exports.Hash_GetState(),n=r(),i=A.exports.memory.buffer,a=new Uint8Array(i,t,n),g=new Uint8Array(4+n);return function(e,t){const n=t.length>>1;for(let A=0;A<n;A++){const n=A<<1;e[A]=E(t.charCodeAt(n),t.charCodeAt(n+1))}}(g,e.hash),g.set(a,4),g},load:t=>{if(!(t instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const n=A.exports.Hash_GetState(),i=r(),a=4+i,g=A.exports.memory.buffer;if(t.length!==a)throw new Error("Bad state length (expected ".concat(a," bytes, got ").concat(t.length,")"));if(!function(e,t){if(e.length!==2*t.length)return!1;for(let n=0;n<t.length;n++){const A=n<<1;if(t[n]!==E(e.charCodeAt(A),e.charCodeAt(A+1)))return!1}return!0}(e.hash,t.subarray(0,4)))throw new Error("This state was written by an incompatible hash implementation");const s=t.subarray(4);new Uint8Array(g,n,i).set(s),o=!0},calculate:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!N(e,t))return g(t),B(e),u("hex",o);const r=C(e);return i.set(r),A.exports.Hash_Calculate(r.length,t,o),s(c,i,n)},hashLength:n}}))}let v="AGFzbQE||BEAF/YAF/AG|AGACf38|wgH|EBAQAw$AQECAgYOAn8BQfCJBQt/AEGACAsHcAgGbWVtb3J5AÔHZXRCdWZmZX|lº0luaXQ|Qtº1VwZGF0ZQACCkhhc2hfRmluYWwABA1º0dldFN0YXRl|UÔDYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKoEoHBQBBkLnQEABCADcDwÈBHEEgBB4AFGIbNgL#QFBAEKnn+anxvST/b5/Qquzj/yRo7Pw2wABs3A+CQrGWgP6fooWs6ABC/6S5iMWR2oKbfy|GzcD2ÈCl7rDg5Onlod3QvLmu+Ojp/2npX8Bs3A9CQti9loj8oLW+NkLnzKfQ1tDrs7t/AbNwPI¥L7wICAX4Gf0EAApA8CJASCtfDcDw`AkACQAJAGnQT9xIgINAEGACSEDDAELAkBBw|msiBC|QEkbIgNFDQA0EDcSEFJBg`aiEGAhAgJANBBEkNACADQfwAcSEHAhAgNAYm#AyACQYAJDFqJBgQ¿NBAmokGCCÀ0ED\vCQYMJHJBBG#AkcN|sLVFDQADQCAGJqJB¿JBAWohAiAFQX9gUN|sLQEsNAU»y|RrIQAgBEGACWohAwsCQC|Qc|SQ0|0AxADNBwABQMEFAaiQT9LDQALCy|RQ0AAhAkÊUDQCACQYCJAWoyACCFQICAFFg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¦JJµAKAI¶CgC·AoA¸IC¹53ºIYXNoX»GA¥QA¼gDCAG½gZgcgDyA¾gEyASEn¿lqLQ|OAÀWot|A6|AÁgEXNxFz\vÂhGE=GE\bhÃDEªM(MÄFEªU(UÅE$aR(RÆEkªS(SÇWogÈ`BÉ$NÊEAIQËBGHQÌDdnMÍgE¢ÎiABÏh0ÐgFÑN3ÒiIÓp3ÔOSGFzaF9ÕgDXMgDHEÖH9PB×^aiBCNØhcZDÙNxÚFzÛ#AmÜkÝÞBAnRBg`ßARlJàhkaC";const N="àßÞÝÜÛÚÙØ×ÖÕÔÓÒÑÐÏÎÍÌËÊÉÈÇÆÅÄÃÂÁÀ¿¾½¼»º¹¸·¶µ´³²±°¯®¬«ª©¨§¦¥¤£¢¡
~}|{`_^][@?>=<;:.-,*)(&%$#! \f\v\t\b";let D;for(D in N){const e=v.split(N[D]);v=e.join(e.pop())}var G={name:"sha256",data:v,hash:"64f06674"};const y=new n;let J=null;e.createSHA256=function(){return u(G,32).then((e=>{e.init(256);const t={init:()=>(e.init(256),t),update:n=>(e.update(n),t),digest:t=>e.digest(t),save:()=>e.save(),load:n=>(e.load(n),t),blockSize:64,digestSize:32};return t}))},e.sha256=function(e){if(null===J)return function(e,n){return t(this,void 0,void 0,(function*(){const t=yield e.lock(),A=yield u(n,32);return t(),A}))}(y,G).then((t=>(J=t,J.calculate(e,256))));try{const t=J.calculate(e,256);return Promise.resolve(t)}catch(e){return Promise.reject(e)}}}));
|
|
File without changes
|