@loaders.gl/crypto 4.2.0-alpha.3 → 4.2.0-alpha.5
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/dist/dist.dev.js +598 -50
- package/dist/dist.min.js +9 -0
- package/dist/index.cjs +27 -546
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -16
- package/dist/lib/algorithms/crc32.js +31 -17
- package/dist/lib/algorithms/crc32c.js +32 -20
- package/dist/lib/algorithms/md5-wasm.js +413 -406
- package/dist/lib/crc32-hash.d.ts +1 -1
- package/dist/lib/crc32-hash.d.ts.map +1 -1
- package/dist/lib/crc32-hash.js +29 -36
- package/dist/lib/crc32c-hash.d.ts +1 -1
- package/dist/lib/crc32c-hash.d.ts.map +1 -1
- package/dist/lib/crc32c-hash.js +34 -36
- package/dist/lib/crypto-hash.d.ts +1 -1
- package/dist/lib/crypto-hash.d.ts.map +1 -1
- package/dist/lib/crypto-hash.js +47 -51
- package/dist/lib/hash.js +20 -30
- package/dist/lib/md5-hash.d.ts +1 -1
- package/dist/lib/md5-hash.d.ts.map +1 -1
- package/dist/lib/md5-hash.js +23 -13
- package/dist/lib/node-hash.d.ts +1 -1
- package/dist/lib/node-hash.d.ts.map +1 -1
- package/dist/lib/node-hash.js +21 -13
- package/dist/lib/sha256-hash.d.ts +1 -1
- package/dist/lib/sha256-hash.d.ts.map +1 -1
- package/dist/lib/sha256-hash.js +9 -10
- package/dist/lib/utils/base64-utils.js +148 -75
- package/dist/lib/utils/digest-utils.js +55 -34
- package/dist/types.js +3 -1
- package/dist/workers/crypto-worker-node.d.ts +1 -1
- package/dist/workers/crypto-worker-node.d.ts.map +1 -1
- package/dist/workers/crypto-worker-node.js +0 -1
- package/dist/workers/crypto-worker.d.ts +2 -2
- package/dist/workers/crypto-worker.d.ts.map +1 -1
- package/dist/workers/crypto-worker.js +17 -17
- package/package.json +10 -7
- package/dist/index.js.map +0 -1
- package/dist/lib/algorithms/crc32.js.map +0 -1
- package/dist/lib/algorithms/crc32c.js.map +0 -1
- package/dist/lib/algorithms/md5-wasm.js.map +0 -1
- package/dist/lib/crc32-hash.js.map +0 -1
- package/dist/lib/crc32c-hash.js.map +0 -1
- package/dist/lib/crypto-hash.js.map +0 -1
- package/dist/lib/hash.js.map +0 -1
- package/dist/lib/md5-hash.js.map +0 -1
- package/dist/lib/node-hash.js.map +0 -1
- package/dist/lib/sha256-hash.js.map +0 -1
- package/dist/lib/utils/base64-utils.js.map +0 -1
- package/dist/lib/utils/digest-utils.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/workers/crypto-worker-node.js.map +0 -1
- package/dist/workers/crypto-worker.js.map +0 -1
- package/dist/workers/cryptojs-worker.ts.disabled +0 -30
package/dist/dist.min.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if (typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
|
+
else if (typeof exports === 'object') exports['loaders'] = factory();
|
|
6
|
+
else root['loaders'] = factory();})(globalThis, function () {
|
|
7
|
+
"use strict";var __exports__=(()=>{var H0=Object.create;var a0=Object.defineProperty;var T0=Object.getOwnPropertyDescriptor;var q0=Object.getOwnPropertyNames;var k0=Object.getPrototypeOf,J0=Object.prototype.hasOwnProperty;var U0=(c,e)=>()=>(e||c((e={exports:{}}).exports,e),e.exports),R0=(c,e)=>{for(var d in e)a0(c,d,{get:e[d],enumerable:!0})},t0=(c,e,d,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let h of q0(e))!J0.call(c,h)&&h!==d&&a0(c,h,{get:()=>e[h],enumerable:!(s=T0(e,h))||s.enumerable});return c},o0=(c,e,d)=>(t0(c,e,"default"),d&&t0(d,e,"default")),L0=(c,e,d)=>(d=c!=null?H0(k0(c)):{},t0(e||!c||!c.__esModule?a0(d,"default",{value:c,enumerable:!0}):d,c)),Z0=c=>t0(a0({},"__esModule",{value:!0}),c);var C0=U0((be,E0)=>{E0.exports=globalThis.loaders});var _={};R0(_,{CRC32CHash:()=>n0,CRC32Hash:()=>A0,CryptoHash:()=>P,CryptoJSWorker:()=>Ae,CryptoWorker:()=>fe,Hash:()=>G,MD5Hash:()=>d0,NodeHash:()=>b0,SHA256Hash:()=>s0,asciiToBase64:()=>c0,base64ToAscii:()=>x0,encodeBase64:()=>I0,encodeHex:()=>f0,encodeNumber:()=>V});o0(_,L0(C0(),1));function w0(...c){return N0(c)}function N0(c){let e=c.map(B=>B instanceof ArrayBuffer?new Uint8Array(B):B),d=e.reduce((B,l)=>B+l.byteLength,0),s=new Uint8Array(d),h=0;for(let B of e)s.set(B,h),h+=B.byteLength;return s.buffer}async function h0(c){let e=[];for await(let d of c)e.push(d);return w0(...e)}var G=class{constructor(e={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(e,d="base64"){let s=[];for await(let l of e)s.push(l),yield l;let h=await this.concatenate(s),B=await this.hash(h,d);this.options.crypto?.onEnd?.({hash:B})}async concatenate(e){return await h0(e)}};var z=class{constructor(){this.crc=-1}update(e){let d=X0(),s=new Uint8Array(e);for(let h=0;h<s.byteLength;h++)this.crc=this.crc>>>8^d[(this.crc^s[h])&255];return this}finalize(){return this.crc=(this.crc^-1)>>>0,this.crc}},V0=Uint32Array.of(0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117);function X0(){return V0}function c0(c){c=`${c}`;for(let d=0;d<c.length;d++)if(c.charCodeAt(d)>255)return null;let e="";for(let d=0;d<c.length;d+=3){let s=[void 0,void 0,void 0,void 0];s[0]=c.charCodeAt(d)>>2,s[1]=(c.charCodeAt(d)&3)<<4,c.length>d+1&&(s[1]|=c.charCodeAt(d+1)>>4,s[2]=(c.charCodeAt(d+1)&15)<<2),c.length>d+2&&(s[2]|=c.charCodeAt(d+2)>>6,s[3]=c.charCodeAt(d+2)&63);for(let h=0;h<s.length;h++)typeof s[h]>"u"?e+="=":e+=P0(s[h])}return e}function x0(c){if(c=`${c}`,c=c.replace(/[ \t\n\f\r]/g,""),c.length%4===0&&(c=c.replace(/[=]=?$/,"")),c.length%4===1||/[^+/0-9A-Za-z]/.test(c))return"";let e="",d=0,s=0;for(let h=0;h<c.length;h++)d<<=6,d|=Y0(c[h]),s+=6,s===24&&(e+=String.fromCharCode((d&16711680)>>16),e+=String.fromCharCode((d&65280)>>8),e+=String.fromCharCode(d&255),d=s=0);return s===12?(d>>=4,e+=String.fromCharCode(d)):s===18&&(d>>=2,e+=String.fromCharCode((d&65280)>>8),e+=String.fromCharCode(d&255)),e}var z0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Y0(c){let e=z0.indexOf(c);return e<0?void 0:e}function P0(c){if(c<26)return String.fromCharCode(c+"A".charCodeAt(0));if(c<52)return String.fromCharCode(c-26+"a".charCodeAt(0));if(c<62)return String.fromCharCode(c-52+"0".charCodeAt(0));if(c===62)return"+";if(c===63)return"/"}function V(c,e){switch(e){case"hex":return g0(c);case"base64":return M0(g0(c));default:throw new Error(e)}}function f0(c,e){switch(e){case"hex":return c;case"base64":return M0(c);default:throw new Error(e)}}function I0(c,e){switch(e){case"hex":return K0(c);case"base64":return c;default:throw new Error(e)}}function M0(c){c.length%2!==0&&(c=`0${c}`);let d=(c.match(/\w{2}/g)||[]).map(s=>String.fromCharCode(parseInt(s,16))).join("");return c0(d)||""}function K0(c){return[...x0(c)].map(e=>e.charCodeAt(0).toString(16).padStart(2,"0")).join("")}function g0(c){let e=c.toString(16);return e==="0"?`0${e}`:e}var A0=class extends G{constructor(e={}){super(),this.name="crc32",this.options={crypto:{},...e},this.hashBatches=this.hashBatches.bind(this)}async hash(e,d){return this.hashSync(e,d)}hashSync(e,d){let s=new z;s.update(e);let h=s.finalize();return V(h,d)}async*hashBatches(e,d="base64"){let s=new z;for await(let B of e)s.update(B),yield B;let h=s.finalize();this.options.crypto?.onEnd?.({hash:V(h,d)})}};var Y=class{constructor(e={}){this.options=e,this.crc=-1}update(e){let d=new Uint8Array(e),s=O0();for(let h=0;h<d.length;h++)this.crc=s[(this.crc^d[h])&255]^this.crc>>>8;return this}finalize(){return this.crc=(this.crc^-1)>>>0,this.crc}},_0=Int32Array.of(0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697);function O0(){return _0}var n0=class extends G{constructor(e={}){super(),this.name="crc32c",this.options={crypto:{},...e}}async hash(e,d){return this.hashSync(e,d)}hashSync(e,d){let s=new Y(this.options);s.update(e);let h=s.finalize();return V(h,d)}async*hashBatches(e,d="base64"){let s=new Y(this.options);for await(let B of e)s.update(B),yield B;let h=s.finalize();this.options.crypto?.onEnd?.({hash:V(h,d)})}};var F0=typeof atob=="function"?atob:typeof Buffer=="function"?ce:W0,$0=F0("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUE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JlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),B0=WebAssembly&&F0!==W0?oe($0).buffer:!1,J=xe(),u0=240*16*16,v0=Math.floor(u0*16*1.066666667),ee=268435456-65536,G0="Parameter must be Buffer, ArrayBuffer or Uint8Array",re="Parameter exceeds max size of 255.9 Mbytes";B0||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function m0(c){var e,d,s,h,B,l,g,F,S,T;let R=ae(),v=te(),W={},D=new Date().getTime();return W.then=function(m){return g=m,w(),W},W.catch=function(m){return F=m,W},c&&typeof c=="object"?typeof Buffer=="function"&&c.constructor===Buffer?l=c:c.constructor===Uint8Array||c.constructor===ArrayBuffer?l=c.constructor===ArrayBuffer?new Uint8Array(c):c:C(new TypeError(G0)):C(new TypeError(G0)),l&&(B=l.length,B0&&B>v0?B>ee?C(new Error(re)):(e=new WebAssembly.Memory({initial:B>32e6?B>64e6?B>128e6?4096:2048:1024:512}),d=new Uint32Array(e.buffer),h={mem:e,log:console.log},s={imports:h},WebAssembly.instantiate(B0,s).then(p)):w(R(l))),W;function p(m){w(v(l,m.instance.exports,d))}function w(m){var H=Boolean(m)?m:S;Boolean(m)&&(T=new Date().getTime()),typeof g=="function"?Boolean(H)&&(g(H,T-D),g=F=null):Boolean(m)&&(S=m)}function C(m){typeof F=="function"&&F(m)}}function te(){var c,e,d,s,h,B,l,g,F,S,T,R,v,W=function(D){var p,w,C,m,H,L,Z,N,u,X,r,t,a,o,q,j,Q,b,O,$,E,ne,de=new Date().getTime(),D0=0,x=1732584193,f=-271733879,A=-1732584194,n=271733878,y=0,K=D.length*8,e0;for(e0=S0(D,v),v[K>>>5]|=128<<K%32,v[(K+64>>>9<<4)+14]=K,e0=(K+64>>>9<<4)+15,E=v;y<e0;)e0>y+v0?(s(x),B(f),g(A),S(n),e(u0),y=y+u0*16,x=d(),f=h(),A=l(),n=F(),D0++):(Q=x,b=f,O=A,$=n,p=E[y+0]>>>0,w=E[y+1]>>>0,C=E[y+2]>>>0,m=E[y+3]>>>0,H=E[y+4]>>>0,L=E[y+5]>>>0,Z=E[y+6]>>>0,N=E[y+7]>>>0,u=E[y+8]>>>0,X=E[y+9]>>>0,r=E[y+10]>>>0,t=E[y+11]>>>0,a=E[y+12]>>>0,o=E[y+13]>>>0,q=E[y+14]>>>0,j=E[y+15]>>>0,x=i(7,25,x+(f&A|~f&n)+p-680876936)+f,n=i(12,20,n+(x&f|~x&A)+w-389564586)+x,A=i(17,15,A+(n&x|~n&f)+C+606105819)+n,f=i(22,10,f+(A&n|~A&x)+m-1044525330)+A,x=i(7,25,x+(f&A|~f&n)+H-176418897)+f,n=i(12,20,n+(x&f|~x&A)+L+1200080426)+x,A=i(17,15,A+(n&x|~n&f)+Z-1473231341)+n,f=i(22,10,f+(A&n|~A&x)+N-45705983)+A,x=i(7,25,x+(f&A|~f&n)+u+1770035416)+f,n=i(12,20,n+(x&f|~x&A)+X-1958414417)+x,A=i(17,15,A+(n&x|~n&f)+r-42063)+n,f=i(22,10,f+(A&n|~A&x)+t-1990404162)+A,x=i(7,25,x+(f&A|~f&n)+a+1804603682)+f,n=i(12,20,n+(x&f|~x&A)+o-40341101)+x,A=i(17,15,A+(n&x|~n&f)+q-1502002290)+n,f=i(22,10,f+(A&n|~A&x)+j+1236535329)+A,x=i(5,27,x+(f&n|A&~n)+w-165796510)+f,n=i(9,23,n+(x&A|f&~A)+Z-1069501632)+x,A=i(14,18,A+(n&f|x&~f)+t+643717713)+n,f=i(20,12,f+(A&x|n&~x)+p-373897302)+A,x=i(5,27,x+(f&n|A&~n)+L-701558691)+f,n=i(9,23,n+(x&A|f&~A)+r+38016083)+x,A=i(14,18,A+(n&f|x&~f)+j-660478335)+n,f=i(20,12,f+(A&x|n&~x)+H-405537848)+A,x=i(5,27,x+(f&n|A&~n)+X+568446438)+f,n=i(9,23,n+(x&A|f&~A)+q-1019803690)+x,A=i(14,18,A+(n&f|x&~f)+m-187363961)+n,f=i(20,12,f+(A&x|n&~x)+u+1163531501)+A,x=i(5,27,x+(f&n|A&~n)+o-1444681467)+f,n=i(9,23,n+(x&A|f&~A)+C-51403784)+x,A=i(14,18,A+(n&f|x&~f)+N+1735328473)+n,f=i(20,12,f+(A&x|n&~x)+a-1926607734)+A,x=i(4,28,x+(f^A^n)+L-378558)+f,n=i(11,21,n+(x^f^A)+u-2022574463)+x,A=i(16,16,A+(n^x^f)+t+1839030562)+n,f=i(23,9,f+(A^n^x)+q-35309556)+A,x=i(4,28,x+(f^A^n)+w-1530992060)+f,n=i(11,21,n+(x^f^A)+H+1272893353)+x,A=i(16,16,A+(n^x^f)+N-155497632)+n,f=i(23,9,f+(A^n^x)+r-1094730640)+A,x=i(4,28,x+(f^A^n)+o+681279174)+f,n=i(11,21,n+(x^f^A)+p-358537222)+x,A=i(16,16,A+(n^x^f)+m-722521979)+n,f=i(23,9,f+(A^n^x)+Z+76029189)+A,x=i(4,28,x+(f^A^n)+X-640364487)+f,n=i(11,21,n+(x^f^A)+a-421815835)+x,A=i(16,16,A+(n^x^f)+j+530742520)+n,f=i(23,9,f+(A^n^x)+C-995338651)+A,x=i(6,26,x+(A^(f|~n))+p-198630844)+f,n=i(10,22,n+(f^(x|~A))+N+1126891415)+x,A=i(15,17,A+(x^(n|~f))+q-1416354905)+n,f=i(21,11,f+(n^(A|~x))+L-57434055)+A,x=i(6,26,x+(A^(f|~n))+a+1700485571)+f,n=i(10,22,n+(f^(x|~A))+m-1894986606)+x,A=i(15,17,A+(x^(n|~f))+r-1051523)+n,f=i(21,11,f+(n^(A|~x))+w-2054922799)+A,x=i(6,26,x+(A^(f|~n))+u+1873313359)+f,n=i(10,22,n+(f^(x|~A))+j-30611744)+x,A=i(15,17,A+(x^(n|~f))+Z-1560198380)+n,f=i(21,11,f+(n^(A|~x))+o+1309151649)+A,x=i(6,26,x+(A^(f|~n))+H-145523070)+f,n=i(10,22,n+(f^(x|~A))+t-1120210379)+x,A=i(15,17,A+(x^(n|~f))+C+718787259)+n,f=i(21,11,f+(n^(A|~x))+X-343485551)+A,y=y+16,x=x+Q>>>0,f=f+b>>>0,A=A+O>>>0,n=n+$>>>0);return J.endian([x,f,A,n]);function i(I,r0,k){return k<<I|k>>>r0}function S0(I,r0){for(var k=-1,i0=Math.floor((I.length-1)/4),M=0,p0,l0,y0,Q0;i0-8>k++;)M=k<<2,r0[k]=I[M+0]|I[M+1]<<8|I[M+2]<<16|I[M+3]<<24;for(k--;i0>k++;)M=k<<2,p0=typeof I[M+0]>"u"?0:I[M+0],l0=typeof I[M+1]>"u"?0:I[M+1],y0=typeof I[M+2]>"u"?0:I[M+2],Q0=typeof I[M+3]>"u"?0:I[M+3],r0[k]=p0|l0<<8|y0<<16|Q0<<24;return i0+1}};return function(D,p,w,C){var m;return e=p.loops,c=p.loop,d=p.getA,h=p.getB,l=p.getC,F=p.getD,T=p.getX,s=p.setA,B=p.setB,g=p.setC,S=p.setD,R=p.setX,v=w,m=J.wordsToBytes(W(D)),C&&C.asBytes?m:J.bytesconvertNumberToHex(m)}}function ae(){var c=function(e,d){var s,h,B,l,g,F,S,T,R,v,W,D,p,w,C,m,H,L,Z,N,u,X=new Date().getTime(),r=1732584193,t=-271733879,a=-1732584194,o=271733878,q=e.length*8;u=J.bytesToWords(e);for(var j=0;j<u.length;j++)u[j]=(u[j]<<8|u[j]>>>24)&16711935|(u[j]<<24|u[j]>>>8)&4278255360;u[q>>>5]|=128<<q%32,u[(q+64>>>9<<4)+14]=q;for(var Q=0;Q<u.length;Q+=16)H=r,L=t,Z=a,N=o,s=u[Q+0]>>>0,h=u[Q+1]>>>0,B=u[Q+2]>>>0,l=u[Q+3]>>>0,g=u[Q+4]>>>0,F=u[Q+5]>>>0,S=u[Q+6]>>>0,T=u[Q+7]>>>0,R=u[Q+8]>>>0,v=u[Q+9]>>>0,W=u[Q+10]>>>0,D=u[Q+11]>>>0,p=u[Q+12]>>>0,w=u[Q+13]>>>0,C=u[Q+14]>>>0,m=u[Q+15]>>>0,r=b(7,25,r+(t&a|~t&o)+s-680876936)+t,o=b(12,20,o+(r&t|~r&a)+h-389564586)+r,a=b(17,15,a+(o&r|~o&t)+B+606105819)+o,t=b(22,10,t+(a&o|~a&r)+l-1044525330)+a,r=b(7,25,r+(t&a|~t&o)+g-176418897)+t,o=b(12,20,o+(r&t|~r&a)+F+1200080426)+r,a=b(17,15,a+(o&r|~o&t)+S-1473231341)+o,t=b(22,10,t+(a&o|~a&r)+T-45705983)+a,r=b(7,25,r+(t&a|~t&o)+R+1770035416)+t,o=b(12,20,o+(r&t|~r&a)+v-1958414417)+r,a=b(17,15,a+(o&r|~o&t)+W-42063)+o,t=b(22,10,t+(a&o|~a&r)+D-1990404162)+a,r=b(7,25,r+(t&a|~t&o)+p+1804603682)+t,o=b(12,20,o+(r&t|~r&a)+w-40341101)+r,a=b(17,15,a+(o&r|~o&t)+C-1502002290)+o,t=b(22,10,t+(a&o|~a&r)+m+1236535329)+a,r=b(5,27,r+(t&o|a&~o)+h-165796510)+t,o=b(9,23,o+(r&a|t&~a)+S-1069501632)+r,a=b(14,18,a+(o&t|r&~t)+D+643717713)+o,t=b(20,12,t+(a&r|o&~r)+s-373897302)+a,r=b(5,27,r+(t&o|a&~o)+F-701558691)+t,o=b(9,23,o+(r&a|t&~a)+W+38016083)+r,a=b(14,18,a+(o&t|r&~t)+m-660478335)+o,t=b(20,12,t+(a&r|o&~r)+g-405537848)+a,r=b(5,27,r+(t&o|a&~o)+v+568446438)+t,o=b(9,23,o+(r&a|t&~a)+C-1019803690)+r,a=b(14,18,a+(o&t|r&~t)+l-187363961)+o,t=b(20,12,t+(a&r|o&~r)+R+1163531501)+a,r=b(5,27,r+(t&o|a&~o)+w-1444681467)+t,o=b(9,23,o+(r&a|t&~a)+B-51403784)+r,a=b(14,18,a+(o&t|r&~t)+T+1735328473)+o,t=b(20,12,t+(a&r|o&~r)+p-1926607734)+a,r=b(4,28,r+(t^a^o)+F-378558)+t,o=b(11,21,o+(r^t^a)+R-2022574463)+r,a=b(16,16,a+(o^r^t)+D+1839030562)+o,t=b(23,9,t+(a^o^r)+C-35309556)+a,r=b(4,28,r+(t^a^o)+h-1530992060)+t,o=b(11,21,o+(r^t^a)+g+1272893353)+r,a=b(16,16,a+(o^r^t)+T-155497632)+o,t=b(23,9,t+(a^o^r)+W-1094730640)+a,r=b(4,28,r+(t^a^o)+w+681279174)+t,o=b(11,21,o+(r^t^a)+s-358537222)+r,a=b(16,16,a+(o^r^t)+l-722521979)+o,t=b(23,9,t+(a^o^r)+S+76029189)+a,r=b(4,28,r+(t^a^o)+v-640364487)+t,o=b(11,21,o+(r^t^a)+p-421815835)+r,a=b(16,16,a+(o^r^t)+m+530742520)+o,t=b(23,9,t+(a^o^r)+B-995338651)+a,r=b(6,26,r+(a^(t|~o))+s-198630844)+t,o=b(10,22,o+(t^(r|~a))+T+1126891415)+r,a=b(15,17,a+(r^(o|~t))+C-1416354905)+o,t=b(21,11,t+(o^(a|~r))+F-57434055)+a,r=b(6,26,r+(a^(t|~o))+p+1700485571)+t,o=b(10,22,o+(t^(r|~a))+l-1894986606)+r,a=b(15,17,a+(r^(o|~t))+W-1051523)+o,t=b(21,11,t+(o^(a|~r))+h-2054922799)+a,r=b(6,26,r+(a^(t|~o))+R+1873313359)+t,o=b(10,22,o+(t^(r|~a))+m-30611744)+r,a=b(15,17,a+(r^(o|~t))+S-1560198380)+o,t=b(21,11,t+(o^(a|~r))+w+1309151649)+a,r=b(6,26,r+(a^(t|~o))+g-145523070)+t,o=b(10,22,o+(t^(r|~a))+D-1120210379)+r,a=b(15,17,a+(r^(o|~t))+B+718787259)+o,t=b(21,11,t+(o^(a|~r))+v-343485551)+a,r=r+H>>>0,t=t+L>>>0,a=a+Z>>>0,o=o+N>>>0;return J.endian([r,t,a,o]);function b(O,$,E){return E<<O|E>>>$}};return function(e,d){var s=J.wordsToBytes(c(e,d)),h=d&&d.asBytes?s:J.bytesconvertNumberToHex(s);return h}}function oe(c){var e,d,s,h=-1;for(e=c.length-1,d=new ArrayBuffer(c.length),s=new Uint8Array(d);e>h++;)s[h]=c.charCodeAt(h);return s}function ce(c){return Buffer.from(c,"base64").toString("binary")}function W0(c){return c}function xe(){var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(e,d){return e<<d|e>>>32-d},endian:function(e){if(e.constructor==Number)return J.rotl(e,8)&16711935|J.rotl(e,24)&4278255360;for(var d=0;d<e.length;d++)e[d]=J.endian(e[d]);return e},bytesToWords:function(e){for(var d=[],s=0,h=0;s<e.length;s++,h+=8)d[h>>>5]|=e[s]<<24-h%32;return d},wordsToBytes:function(e){for(var d=[],s=0;s<e.length*32;s+=8)d.push(e[s>>>5]>>>24-s%32&255);return d},bytesconvertNumberToHex:function(e){for(var d=[],s=0;s<e.length;s++)d.push((e[s]>>>4).toString(16)),d.push((e[s]&15).toString(16));return d.join("")}}}var d0=class extends G{constructor(e={}){super(),this.name="md5",this.options=e}async hash(e,d){let h=await new Promise((B,l)=>m0(e).then(B).catch(l));return f0(h,d)}};var U,P=class extends G{constructor(e){if(super(),this.options=e,this._algorithm=this.options?.crypto?.algorithm,!this._algorithm)throw new Error(this.name);this.name=this._algorithm.toLowerCase()}async preload(){if(U||(U=this.options?.modules?.CryptoJS),!U)throw new Error(this.name);this._algo=U.algo[this._algorithm]}async hash(e,d){await this.preload();let s=this._algo.create();if(!s)throw new Error(this.name);let h=U.lib.WordArray.create(e),B=d==="base64"?U.enc.Base64:U.enc.Hex;return s.update(h).finalize().toString(B)}async*hashBatches(e,d="base64"){await this.preload();let s=this._algo.create();if(!s)throw new Error(this.name);for await(let l of e){let g=U.lib.WordArray.create(l);s.update(g),yield l}let h=d==="base64"?U.enc.Base64:U.enc.Hex,B=s.finalize().toString(h);this.options?.crypto?.onEnd?.({hash:B})}};var s0=class extends P{constructor(e){super({...e,crypto:{...e.crypto,algorithm:"SHA256"}})}};var b0=class extends G{constructor(e){if(super(),this.options=e,!globalThis.loaders.NodeHash)throw new Error("install @loaders.gl/crypto on Node.js to use NodeHash");return new globalThis.loaders.NodeHash(e)}async hash(e,d){throw new Error("Not implemented")}};var j0="4.2.0-alpha.4",fe={id:"crypto",name:"CRC32, CRC32c and MD5 Hashes",module:"crypto",version:j0,options:{crypto:{}}},Ae={id:"cryptojs",name:"Cryptographic Hashes",module:"crypto",version:j0,options:{cryptojs:{}}};return Z0(_);})();
|
|
8
|
+
return __exports__;
|
|
9
|
+
});
|