tornado-scripts/dist/merkleTreeWorker.umd.min.js

2 lines
1.8 MiB
JavaScript
Raw Permalink Normal View History

/*! For license information please see merkleTreeWorker.umd.min.js.LICENSE.txt */
2025-01-21 17:34:04 +00:00
globalThis.process={browser:!0,env:{}},function(e,a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var c=a();for(var f in c)("object"==typeof exports?exports:e)[f]=c[f]}}(self,(()=>(()=>{var __webpack_modules__={8176:(e,a,c)=>{const f=c(6613);a.cidForWeb=e=>{let a=new f(e);0===a.version&&(a=a.toV1());let c=a.toString("base32");if(c.length>63){const e=a.toString("base36");if(e.length<=63)return e;throw new TypeError("CID is longer than DNS limit of 63 characters and is not compatible with public gateways")}return c},a.cidV0ToV1Base32=e=>{let a=new f(e);return 0===a.version&&(a=a.toV1()),a.toString("base32")}},1810:(e,a,c)=>{const f=c(2021),d=c(4243),{hexStringToBuffer:b,profiles:t}=c(5262),{cidForWeb:i,cidV0ToV1Base32:r}=c(8176);e.exports={helpers:{cidForWeb:i,cidV0ToV1Base32:r},decode:function(e){const a=b(e),c=f.getCodec(a),d=f.rmPrefix(a);let i=t[c];return i||(i=t.default),i.decode(d)},fromIpfs:function(e){return this.encode("ipfs-ns",e)},fromSkylink:function(e){return this.encode("skynet-ns",e)},fromSwarm:function(e){return this.encode("swarm-ns",e)},fromArweave:function(e){return this.encode("arweave-ns",e)},encode:function(e,a){let c=t[e];c||(c=t.default);const b=c.encode(a);return d.toHexString(f.addPrefix(e,b))},getCodec:function(e){let a=b(e);return f.getCodec(a)}}},5262:(e,a,c)=>{var f=c(8287).Buffer;const d=c(6613),b=c(4243),t=c(8127),i=e=>{let a=e.slice(0,2),c=e.slice(2),f="";return f="0x"===a?c:e,b.fromHexString(f)},r=e=>{try{const{multihash:a}=e;if(a.length<38){const e=b.decode(a);if("identity"===e.name&&e.length<36)return!1}return!0}catch(e){return!1}},n={skynet:e=>t.toUint8Array(e),swarm:e=>{const a=b.encode(i(e),"keccak-256");return new d(1,"swarm-manifest",a).bytes},ipfs:e=>new d(e).toV1().bytes,ipns:e=>{const a=new d(e);if(!r(a))throw Error("ipns-ns allows only valid cryptographic libp2p-key identifiers, try using ED25519 pubkey instead");return new d(1,"libp2p-key",a.multihash).bytes},utf8:e=>f.from(e,"utf8"),arweave:e=>t.toUint8Array(e)},o={hexMultiHash:e=>{const a=new d(e);return b.decode(a.multihash).digest.toString("hex")},ipfs:e=>{const a=new d(e).toV1();return a.toString("libp2p-key"===a.codec?"base36":"base32")},ipns:e=>{const a=new d(e).toV1();return r(a)?a.toString("base36"):(console.warn("[ensdomains/content-hash] use of non-cryptographic identifiers in ipns-ns is deprecated and will be removed, migrate to ED25519 libp2p-key"),String(b.decode(new d(e).multihash).digest))},utf8:e=>e.toString("utf8"),base64:e=>t.fromUint8Array(e,!0)},s={"skynet-ns":{encode:n.skynet,decode:o.base64},"swarm-ns":{encode:n.swarm,decode:o.hexMultiHash},"ipfs-ns":{encode:n.ipfs,decode:o.ipfs},"ipns-ns":{encode:n.ipns,decode:o.ipns},"arweave-ns":{encode:n.arweave,decode:o.base64},default:{encode:n.utf8,decode:o.utf8}};a.hexStringToBuffer=i,a.profiles=s},5084:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var a=new Uint8Array(256),c=0;c<a.length;c++)a[c]=255;for(var f=0;f<e.length;f++){var d=e.charAt(f),b=d.charCodeAt(0);if(255!==a[b])throw new TypeError(d+" is ambiguous");a[b]=f}var t=e.length,i=e.charAt(0),r=Math.log(t)/Math.log(256),n=Math.log(256)/Math.log(t);function o(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var c=0;if(" "!==e[c]){for(var f=0,d=0;e[c]===i;)f++,c++;for(var b=(e.length-c)*r+1>>>0,n=new Uint8Array(b);e[c];){var o=a[e.charCodeAt(c)];if(255===o)return;for(var s=0,l=b-1;(0!==o||s<d)&&-1!==l;l--,s++)o+=t*n[l]>>>0,n[l]=o%256>>>0,o=o/256>>>0;if(0!==o)throw new Error("Non-zero carry");d=s,c++}if(" "!==e[c]){for(var h=b-d;h!==b&&0===n[h];)h++;for(var u=new Uint8Array(f+(b-h)),x=f;h!==b;)u[x++]=n[h++];return u}}}return{encode:function(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===a.length)return"";for(var c=0,f=0,d=0,b=a.length;d