@loaders.gl/crypto 4.2.0-alpha.4 → 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.
Files changed (56) hide show
  1. package/dist/dist.dev.js +598 -50
  2. package/dist/dist.min.js +9 -0
  3. package/dist/index.cjs +27 -546
  4. package/dist/index.cjs.map +7 -0
  5. package/dist/index.d.ts +9 -9
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +27 -15
  8. package/dist/lib/algorithms/crc32.js +31 -17
  9. package/dist/lib/algorithms/crc32c.js +32 -20
  10. package/dist/lib/algorithms/md5-wasm.js +413 -406
  11. package/dist/lib/crc32-hash.d.ts +1 -1
  12. package/dist/lib/crc32-hash.d.ts.map +1 -1
  13. package/dist/lib/crc32-hash.js +29 -36
  14. package/dist/lib/crc32c-hash.d.ts +1 -1
  15. package/dist/lib/crc32c-hash.d.ts.map +1 -1
  16. package/dist/lib/crc32c-hash.js +34 -36
  17. package/dist/lib/crypto-hash.d.ts +1 -1
  18. package/dist/lib/crypto-hash.d.ts.map +1 -1
  19. package/dist/lib/crypto-hash.js +47 -51
  20. package/dist/lib/hash.js +20 -30
  21. package/dist/lib/md5-hash.d.ts +1 -1
  22. package/dist/lib/md5-hash.d.ts.map +1 -1
  23. package/dist/lib/md5-hash.js +23 -13
  24. package/dist/lib/node-hash.d.ts +1 -1
  25. package/dist/lib/node-hash.d.ts.map +1 -1
  26. package/dist/lib/node-hash.js +21 -13
  27. package/dist/lib/sha256-hash.d.ts +1 -1
  28. package/dist/lib/sha256-hash.d.ts.map +1 -1
  29. package/dist/lib/sha256-hash.js +9 -10
  30. package/dist/lib/utils/base64-utils.js +148 -75
  31. package/dist/lib/utils/digest-utils.js +55 -34
  32. package/dist/types.js +3 -1
  33. package/dist/workers/crypto-worker-node.d.ts +1 -1
  34. package/dist/workers/crypto-worker-node.d.ts.map +1 -1
  35. package/dist/workers/crypto-worker-node.js +0 -1
  36. package/dist/workers/crypto-worker.d.ts +2 -2
  37. package/dist/workers/crypto-worker.d.ts.map +1 -1
  38. package/dist/workers/crypto-worker.js +17 -17
  39. package/package.json +10 -7
  40. package/dist/index.js.map +0 -1
  41. package/dist/lib/algorithms/crc32.js.map +0 -1
  42. package/dist/lib/algorithms/crc32c.js.map +0 -1
  43. package/dist/lib/algorithms/md5-wasm.js.map +0 -1
  44. package/dist/lib/crc32-hash.js.map +0 -1
  45. package/dist/lib/crc32c-hash.js.map +0 -1
  46. package/dist/lib/crypto-hash.js.map +0 -1
  47. package/dist/lib/hash.js.map +0 -1
  48. package/dist/lib/md5-hash.js.map +0 -1
  49. package/dist/lib/node-hash.js.map +0 -1
  50. package/dist/lib/sha256-hash.js.map +0 -1
  51. package/dist/lib/utils/base64-utils.js.map +0 -1
  52. package/dist/lib/utils/digest-utils.js.map +0 -1
  53. package/dist/types.js.map +0 -1
  54. package/dist/workers/crypto-worker-node.js.map +0 -1
  55. package/dist/workers/crypto-worker.js.map +0 -1
  56. package/dist/workers/cryptojs-worker.ts.disabled +0 -30
@@ -1,87 +1,160 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ /**
5
+ * `btoa()` polyfill as defined by the HTML and Infra specs, which mostly just references
6
+ * RFC 4648.
7
+ */
1
8
  export function asciiToBase64(string) {
2
- string = `${string}`;
3
- for (let i = 0; i < string.length; i++) {
4
- if (string.charCodeAt(i) > 255) {
5
- return null;
9
+ // String conversion as required by Web IDL.
10
+ string = `${string}`;
11
+ // "The btoa() method must throw an "InvalidCharacterError" DOMException if
12
+ // data contains any character whose code point is greater than U+00FF."
13
+ for (let i = 0; i < string.length; i++) {
14
+ if (string.charCodeAt(i) > 255) {
15
+ return null;
16
+ }
6
17
  }
7
- }
8
- let out = '';
9
- for (let i = 0; i < string.length; i += 3) {
10
- const groupsOfSix = [undefined, undefined, undefined, undefined];
11
- groupsOfSix[0] = string.charCodeAt(i) >> 2;
12
- groupsOfSix[1] = (string.charCodeAt(i) & 0x03) << 4;
13
- if (string.length > i + 1) {
14
- groupsOfSix[1] |= string.charCodeAt(i + 1) >> 4;
15
- groupsOfSix[2] = (string.charCodeAt(i + 1) & 0x0f) << 2;
18
+ let out = '';
19
+ for (let i = 0; i < string.length; i += 3) {
20
+ /** @type {Array[4]} */
21
+ const groupsOfSix = [undefined, undefined, undefined, undefined];
22
+ groupsOfSix[0] = string.charCodeAt(i) >> 2;
23
+ groupsOfSix[1] = (string.charCodeAt(i) & 0x03) << 4;
24
+ if (string.length > i + 1) {
25
+ groupsOfSix[1] |= string.charCodeAt(i + 1) >> 4;
26
+ groupsOfSix[2] = (string.charCodeAt(i + 1) & 0x0f) << 2;
27
+ }
28
+ if (string.length > i + 2) {
29
+ // @ts-expect-error
30
+ groupsOfSix[2] |= string.charCodeAt(i + 2) >> 6;
31
+ groupsOfSix[3] = string.charCodeAt(i + 2) & 0x3f;
32
+ }
33
+ for (let j = 0; j < groupsOfSix.length; j++) {
34
+ if (typeof groupsOfSix[j] === 'undefined') {
35
+ out += '=';
36
+ }
37
+ else {
38
+ out += btoaLookup(groupsOfSix[j]);
39
+ }
40
+ }
16
41
  }
17
- if (string.length > i + 2) {
18
- groupsOfSix[2] |= string.charCodeAt(i + 2) >> 6;
19
- groupsOfSix[3] = string.charCodeAt(i + 2) & 0x3f;
20
- }
21
- for (let j = 0; j < groupsOfSix.length; j++) {
22
- if (typeof groupsOfSix[j] === 'undefined') {
23
- out += '=';
24
- } else {
25
- out += btoaLookup(groupsOfSix[j]);
26
- }
27
- }
28
- }
29
- return out;
42
+ return out;
30
43
  }
44
+ /**
45
+ * Implementation of atob() according to the HTML and Infra specs, except that
46
+ * instead of throwing INVALID_CHARACTER_ERR we return null.
47
+ *
48
+ * @note Forked from https://github.com/jsdom/abab under BSD 3 clause license
49
+ */
31
50
  export function base64ToAscii(data) {
32
- data = `${data}`;
33
- data = data.replace(/[ \t\n\f\r]/g, '');
34
- if (data.length % 4 === 0) {
35
- data = data.replace(/[=]=?$/, '');
36
- }
37
- if (data.length % 4 === 1 || /[^+/0-9A-Za-z]/.test(data)) {
38
- return '';
39
- }
40
- let output = '';
41
- let buffer = 0;
42
- let accumulatedBits = 0;
43
- for (let i = 0; i < data.length; i++) {
44
- buffer <<= 6;
45
- buffer |= atobLookup(data[i]);
46
- accumulatedBits += 6;
47
- if (accumulatedBits === 24) {
48
- output += String.fromCharCode((buffer & 0xff0000) >> 16);
49
- output += String.fromCharCode((buffer & 0xff00) >> 8);
50
- output += String.fromCharCode(buffer & 0xff);
51
- buffer = accumulatedBits = 0;
51
+ // Web IDL requires DOMStrings to just be converted using ECMAScript
52
+ // ToString, which in our case amounts to using a template literal.
53
+ data = `${data}`;
54
+ // "Remove all ASCII whitespace from data."
55
+ data = data.replace(/[ \t\n\f\r]/g, '');
56
+ // "If data's code point length divides by 4 leaving no remainder, then: if data ends
57
+ // with one or two U+003D (=) code points, then remove them from data."
58
+ if (data.length % 4 === 0) {
59
+ data = data.replace(/[=]=?$/, '');
60
+ }
61
+ // "If data's code point length divides by 4 leaving a remainder of 1, then return
62
+ // failure."
63
+ //
64
+ // "If data contains a code point that is not one of
65
+ //
66
+ // U+002B (+)
67
+ // U+002F (/)
68
+ // ASCII alphanumeric
69
+ //
70
+ // then return failure."
71
+ if (data.length % 4 === 1 || /[^+/0-9A-Za-z]/.test(data)) {
72
+ return '';
73
+ }
74
+ // "Let output be an empty byte sequence."
75
+ let output = '';
76
+ // "Let buffer be an empty buffer that can have bits appended to it."
77
+ //
78
+ // We append bits via left-shift and or. accumulatedBits is used to track
79
+ // when we've gotten to 24 bits.
80
+ let buffer = 0;
81
+ let accumulatedBits = 0;
82
+ // "Let position be a position variable for data, initially pointing at the
83
+ // start of data."
84
+ //
85
+ // "While position does not point past the end of data:"
86
+ for (let i = 0; i < data.length; i++) {
87
+ // "Find the code point pointed to by position in the second column of
88
+ // Table 1: The Base 64 Alphabet of RFC 4648. Let n be the number given in
89
+ // the first cell of the same row.
90
+ //
91
+ // "Append to buffer the six bits corresponding to n, most significant bit
92
+ // first."
93
+ //
94
+ // atobLookup() implements the table from RFC 4648.
95
+ buffer <<= 6;
96
+ // @ts-expect-error
97
+ buffer |= atobLookup(data[i]);
98
+ accumulatedBits += 6;
99
+ // "If buffer has accumulated 24 bits, interpret them as three 8-bit
100
+ // big-endian numbers. Append three bytes with values equal to those
101
+ // numbers to output, in the same order, and then empty buffer."
102
+ if (accumulatedBits === 24) {
103
+ output += String.fromCharCode((buffer & 0xff0000) >> 16);
104
+ output += String.fromCharCode((buffer & 0xff00) >> 8);
105
+ output += String.fromCharCode(buffer & 0xff);
106
+ buffer = accumulatedBits = 0;
107
+ }
108
+ // "Advance position by 1."
109
+ }
110
+ // "If buffer is not empty, it contains either 12 or 18 bits. If it contains
111
+ // 12 bits, then discard the last four and interpret the remaining eight as
112
+ // an 8-bit big-endian number. If it contains 18 bits, then discard the last
113
+ // two and interpret the remaining 16 as two 8-bit big-endian numbers. Append
114
+ // the one or two bytes with values equal to those one or two numbers to
115
+ // output, in the same order."
116
+ if (accumulatedBits === 12) {
117
+ buffer >>= 4;
118
+ output += String.fromCharCode(buffer);
119
+ }
120
+ else if (accumulatedBits === 18) {
121
+ buffer >>= 2;
122
+ output += String.fromCharCode((buffer & 0xff00) >> 8);
123
+ output += String.fromCharCode(buffer & 0xff);
52
124
  }
53
- }
54
- if (accumulatedBits === 12) {
55
- buffer >>= 4;
56
- output += String.fromCharCode(buffer);
57
- } else if (accumulatedBits === 18) {
58
- buffer >>= 2;
59
- output += String.fromCharCode((buffer & 0xff00) >> 8);
60
- output += String.fromCharCode(buffer & 0xff);
61
- }
62
- return output;
125
+ // "Return output."
126
+ return output;
63
127
  }
128
+ /**
129
+ * A lookup table for atob(), which converts an ASCII character to the
130
+ * corresponding six-bit number.
131
+ */
64
132
  const keystr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
65
133
  function atobLookup(chr) {
66
- const index = keystr.indexOf(chr);
67
- return index < 0 ? undefined : index;
134
+ const index = keystr.indexOf(chr);
135
+ // Throw exception if character is not in the lookup string; should not be hit in tests
136
+ return index < 0 ? undefined : index;
68
137
  }
138
+ /**
139
+ * Lookup table for btoa(), which converts a six-bit number into the
140
+ * corresponding ASCII character.
141
+ */
69
142
  function btoaLookup(idx) {
70
- if (idx < 26) {
71
- return String.fromCharCode(idx + 'A'.charCodeAt(0));
72
- }
73
- if (idx < 52) {
74
- return String.fromCharCode(idx - 26 + 'a'.charCodeAt(0));
75
- }
76
- if (idx < 62) {
77
- return String.fromCharCode(idx - 52 + '0'.charCodeAt(0));
78
- }
79
- if (idx === 62) {
80
- return '+';
81
- }
82
- if (idx === 63) {
83
- return '/';
84
- }
85
- return undefined;
143
+ if (idx < 26) {
144
+ return String.fromCharCode(idx + 'A'.charCodeAt(0));
145
+ }
146
+ if (idx < 52) {
147
+ return String.fromCharCode(idx - 26 + 'a'.charCodeAt(0));
148
+ }
149
+ if (idx < 62) {
150
+ return String.fromCharCode(idx - 52 + '0'.charCodeAt(0));
151
+ }
152
+ if (idx === 62) {
153
+ return '+';
154
+ }
155
+ if (idx === 63) {
156
+ return '/';
157
+ }
158
+ // Throw INVALID_CHARACTER_ERR exception here -- won't be hit in the teststring.
159
+ return undefined;
86
160
  }
87
- //# sourceMappingURL=base64-utils.js.map
@@ -1,47 +1,68 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import { asciiToBase64, base64ToAscii } from "./base64-utils.js";
5
+ /**
6
+ * Encode a number (usually a digest from a hash function / cipher) as either hex or base64
7
+ * Suitable for hashes like CRC32 where the number of required bits fit withing a JavaScript number.
8
+ */
2
9
  export function encodeNumber(number, encoding) {
3
- switch (encoding) {
4
- case 'hex':
5
- return convertNumberToHex(number);
6
- case 'base64':
7
- return convertHexToBase64(convertNumberToHex(number));
8
- default:
9
- throw new Error(encoding);
10
- }
10
+ switch (encoding) {
11
+ case 'hex':
12
+ return convertNumberToHex(number);
13
+ case 'base64':
14
+ return convertHexToBase64(convertNumberToHex(number));
15
+ default:
16
+ throw new Error(encoding);
17
+ }
11
18
  }
19
+ /** Encode a hex string, aeither return hex or re-encode as base64 */
12
20
  export function encodeHex(hex, encoding) {
13
- switch (encoding) {
14
- case 'hex':
15
- return hex;
16
- case 'base64':
17
- return convertHexToBase64(hex);
18
- default:
19
- throw new Error(encoding);
20
- }
21
+ switch (encoding) {
22
+ case 'hex':
23
+ return hex;
24
+ case 'base64':
25
+ return convertHexToBase64(hex);
26
+ default:
27
+ throw new Error(encoding);
28
+ }
21
29
  }
22
30
  export function encodeBase64(base64, encoding) {
23
- switch (encoding) {
24
- case 'hex':
25
- return convertBase64ToHex(base64);
26
- case 'base64':
27
- return base64;
28
- default:
29
- throw new Error(encoding);
30
- }
31
+ switch (encoding) {
32
+ case 'hex':
33
+ return convertBase64ToHex(base64);
34
+ case 'base64':
35
+ return base64;
36
+ default:
37
+ throw new Error(encoding);
38
+ }
31
39
  }
40
+ /**
41
+ * Convert a hexadecimal string to base64 encoded string representation
42
+ */
32
43
  function convertHexToBase64(hexstring) {
33
- if (hexstring.length % 2 !== 0) {
34
- hexstring = `0${hexstring}`;
35
- }
36
- const matches = hexstring.match(/\w{2}/g) || [];
37
- const string = matches.map(a => String.fromCharCode(parseInt(a, 16))).join('');
38
- return asciiToBase64(string) || '';
44
+ // Add leading zero to keep even count of digits
45
+ // eg. f85d741 => 0f85d741
46
+ if (hexstring.length % 2 !== 0) {
47
+ hexstring = `0${hexstring}`;
48
+ }
49
+ const matches = hexstring.match(/\w{2}/g) || [];
50
+ const string = matches.map((a) => String.fromCharCode(parseInt(a, 16))).join('');
51
+ // TODO - define how to handle failures
52
+ return asciiToBase64(string) || '';
39
53
  }
54
+ /**
55
+ * Convert a base64 encoded string to hexadecimal encoded string representation
56
+ */
40
57
  function convertBase64ToHex(base64String) {
41
- return [...base64ToAscii(base64String)].map(c => c.charCodeAt(0).toString(16).padStart(2, '0')).join('');
58
+ return [...base64ToAscii(base64String)]
59
+ .map((c) => c.charCodeAt(0).toString(16).padStart(2, '0'))
60
+ .join('');
42
61
  }
62
+ /**
63
+ * Converts a number to hex
64
+ */
43
65
  function convertNumberToHex(cipher) {
44
- const hexString = cipher.toString(16);
45
- return hexString === '0' ? `0${hexString}` : hexString;
66
+ const hexString = cipher.toString(16);
67
+ return hexString === '0' ? `0${hexString}` : hexString;
46
68
  }
47
- //# sourceMappingURL=digest-utils.js.map
package/dist/types.js CHANGED
@@ -1,2 +1,4 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -1,2 +1,2 @@
1
- import './crypto-worker';
1
+ import "./crypto-worker.js";
2
2
  //# sourceMappingURL=crypto-worker-node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypto-worker-node.d.ts","sourceRoot":"","sources":["../../src/workers/crypto-worker-node.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC"}
1
+ {"version":3,"file":"crypto-worker-node.d.ts","sourceRoot":"","sources":["../../src/workers/crypto-worker-node.ts"],"names":[],"mappings":"AAAA,4BAAyB"}
@@ -1,2 +1 @@
1
1
  import "./crypto-worker.js";
2
- //# sourceMappingURL=crypto-worker-node.js.map
@@ -1,4 +1,4 @@
1
- import { CRC32Hash } from '../lib/crc32-hash';
2
- import { CRC32CHash } from '../lib/crc32c-hash';
1
+ import { CRC32Hash } from "../lib/crc32-hash.js";
2
+ import { CRC32CHash } from "../lib/crc32c-hash.js";
3
3
  export { CRC32Hash, CRC32CHash };
4
4
  //# sourceMappingURL=crypto-worker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypto-worker.d.ts","sourceRoot":"","sources":["../../src/workers/crypto-worker.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAI9C,OAAO,EAAC,SAAS,EAAE,UAAU,EAAC,CAAC"}
1
+ {"version":3,"file":"crypto-worker.d.ts","sourceRoot":"","sources":["../../src/workers/crypto-worker.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,SAAS,EAAC,6BAA0B;AAC5C,OAAO,EAAC,UAAU,EAAC,8BAA2B;AAI9C,OAAO,EAAC,SAAS,EAAE,UAAU,EAAC,CAAC"}
@@ -1,23 +1,23 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import { createWorker } from '@loaders.gl/worker-utils';
2
5
  import { CRC32Hash } from "../lib/crc32-hash.js";
3
6
  import { CRC32CHash } from "../lib/crc32c-hash.js";
4
7
  import { MD5Hash } from "../lib/md5-hash.js";
8
+ // Assuming we can bundle as module
5
9
  export { CRC32Hash, CRC32CHash };
6
- createWorker(async function (data) {
7
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8
- const {
9
- operation,
10
- encoding = 'base64'
11
- } = options;
12
- switch (operation) {
13
- case 'crc32':
14
- return await new CRC32Hash(options).hash(data, encoding);
15
- case 'crc32c':
16
- return await new CRC32CHash(options).hash(data, encoding);
17
- case 'md5':
18
- return await new MD5Hash(options).hash(data, encoding);
19
- default:
20
- throw new Error(`invalid option: ${operation}`);
21
- }
10
+ createWorker(async (data, options = {}) => {
11
+ // @ts-ignore
12
+ const { operation, encoding = 'base64' } = options;
13
+ switch (operation) {
14
+ case 'crc32':
15
+ return await new CRC32Hash(options).hash(data, encoding);
16
+ case 'crc32c':
17
+ return await new CRC32CHash(options).hash(data, encoding);
18
+ case 'md5':
19
+ return await new MD5Hash(options).hash(data, encoding);
20
+ default:
21
+ throw new Error(`invalid option: ${operation}`);
22
+ }
22
23
  });
23
- //# sourceMappingURL=crypto-worker.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/crypto",
3
- "version": "4.2.0-alpha.4",
3
+ "version": "4.2.0-alpha.5",
4
4
  "description": "Cryptographic/hashing plugins for loaders.gl",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,15 +39,15 @@
39
39
  "README.md"
40
40
  ],
41
41
  "scripts": {
42
- "pre-build": "npm run build-bundle && npm run build-bundle -- --env=dev && npm run build-worker && npm run build-worker-node",
43
- "build-bundle": "ocular-bundle ./src/index.ts",
42
+ "pre-build": "npm run build-bundle && npm run build-bundle-dev && npm run build-worker && npm run build-worker-node",
43
+ "build-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.min.js",
44
+ "build-bundle-dev": "ocular-bundle ./bundle.ts --env=dev --output=dist/dist.dev.js",
44
45
  "build-worker": "esbuild src/workers/crypto-worker.ts --outfile=dist/crypto-worker.js --target=esnext --bundle --minify --sourcemap --define:__VERSION__=\\\"$npm_package_version\\\"",
45
46
  "build-worker-node": "esbuild src/workers/crypto-worker-node.ts --outfile=dist/crypto-worker-node.js --platform=node --target=esnext,node16 --bundle --minify --sourcemap --define:__VERSION__=\\\"$npm_package_version\\\""
46
47
  },
47
48
  "dependencies": {
48
- "@babel/runtime": "^7.3.1",
49
- "@loaders.gl/loader-utils": "4.2.0-alpha.4",
50
- "@loaders.gl/worker-utils": "4.2.0-alpha.4",
49
+ "@loaders.gl/loader-utils": "4.2.0-alpha.5",
50
+ "@loaders.gl/worker-utils": "4.2.0-alpha.5",
51
51
  "@types/crypto-js": "^4.0.2"
52
52
  },
53
53
  "devDependencies": {
@@ -57,5 +57,8 @@
57
57
  "crypto": false,
58
58
  "sse4_crc32": false
59
59
  },
60
- "gitHead": "6c52dee5c3f005648a394cc4aee7fc37005c8e83"
60
+ "peerDependencies": {
61
+ "@loaders.gl/core": "^4.0.0"
62
+ },
63
+ "gitHead": "32d95a81971f104e4dfeb88ab57065f05321a76a"
61
64
  }
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["VERSION","Hash","CRC32Hash","CRC32CHash","MD5Hash","SHA256Hash","CryptoHash","NodeHash","CryptoWorker","id","name","module","version","options","crypto","CryptoJSWorker","cryptojs","encodeNumber","encodeHex","encodeBase64","asciiToBase64","base64ToAscii"],"sources":["../src/index.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport {Hash} from './lib/hash';\n\nexport {CRC32Hash} from './lib/crc32-hash';\nexport {CRC32CHash} from './lib/crc32c-hash';\nexport {MD5Hash} from './lib/md5-hash';\nexport {SHA256Hash} from './lib/sha256-hash';\n\nexport {CryptoHash} from './lib/crypto-hash';\nexport {NodeHash} from './lib/node-hash';\n\n/**\n * Small, fast worker for CRC32, CRC32c and MD5 Hashes\n */\nexport const CryptoWorker = {\n id: 'crypto',\n name: 'CRC32, CRC32c and MD5 Hashes',\n module: 'crypto',\n version: VERSION,\n options: {\n crypto: {}\n }\n};\n\n/**\n * Large worker for full complement of Cryptographic Hashes\n * bundles the full crypto.js library\n */\nexport const CryptoJSWorker = {\n id: 'cryptojs',\n name: 'Cryptographic Hashes',\n module: 'crypto',\n version: VERSION,\n options: {\n cryptojs: {}\n }\n};\n\n// EXPERIMENTAL\n\nexport {encodeNumber, encodeHex, encodeBase64} from './lib/utils/digest-utils';\nexport {asciiToBase64, base64ToAscii} from './lib/utils/base64-utils';\n"],"mappings":"AAMA,MAAMA,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAAC,SAEpEC,IAAI;AAAA,SAEJC,SAAS;AAAA,SACTC,UAAU;AAAA,SACVC,OAAO;AAAA,SACPC,UAAU;AAAA,SAEVC,UAAU;AAAA,SACVC,QAAQ;AAKhB,OAAO,MAAMC,YAAY,GAAG;EAC1BC,EAAE,EAAE,QAAQ;EACZC,IAAI,EAAE,8BAA8B;EACpCC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAEZ,OAAO;EAChBa,OAAO,EAAE;IACPC,MAAM,EAAE,CAAC;EACX;AACF,CAAC;AAMD,OAAO,MAAMC,cAAc,GAAG;EAC5BN,EAAE,EAAE,UAAU;EACdC,IAAI,EAAE,sBAAsB;EAC5BC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAEZ,OAAO;EAChBa,OAAO,EAAE;IACPG,QAAQ,EAAE,CAAC;EACb;AACF,CAAC;AAAC,SAIMC,YAAY,EAAEC,SAAS,EAAEC,YAAY;AAAA,SACrCC,aAAa,EAAEC,aAAa"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"crc32.js","names":["CRC32","constructor","crc","update","arrayBuffer","CRC32_TABLE","getCRC32Table","byteArray","Uint8Array","i","byteLength","finalize","CRC32TAB","Uint32Array","of"],"sources":["../../../src/lib/algorithms/crc32.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// Inspired by https://gist.github.com/wqli78/1330293/6d85cc967f32cccfcbad94ae7d088a3dcfc14bd9\n// Full crc32 docs: https://www.kernel.org/doc/Documentation/crc32.txt\n// Better JS implementation: https://stackoverflow.com/a/18639999\n/**\n * Calculates the CRC32 checksum of a string.\n */\nexport default class CRC32 {\n crc: number;\n\n constructor() {\n this.crc = ~0;\n }\n\n update(arrayBuffer) {\n const CRC32_TABLE = getCRC32Table();\n const byteArray = new Uint8Array(arrayBuffer);\n for (let i = 0; i < byteArray.byteLength; i++) {\n this.crc = (this.crc >>> 8) ^ CRC32_TABLE[(this.crc ^ byteArray[i]) & 0xff];\n // strings: crc = (crc >>> 8) ^ CRC32TAB[(crc ^ str.charCodeAt(i)) & 0xff];\n }\n return this;\n }\n\n finalize() {\n // performing final division and making crc unsigned.\n // The reason why we can't use Math.abs() ther is that 1 in bite representation is 00000000000000000000000000000001\n // and -1 is 11111111111111111111111111111111. So Math.abs() completely changes the bits there,\n // but what we need is just make JS count first 1 bit as a part of a number and not the sign marker.\n // We don't need to change anything else in this bit representation. And that's exactly what >>> does.\n this.crc = (this.crc ^ -1) >>> 0;\n return this.crc;\n }\n}\n\n// Note: Using a typed array here doubles the speed of the cipher\nconst CRC32TAB = Uint32Array.of(\n 0x00000000,\n 0x77073096,\n 0xee0e612c,\n 0x990951ba,\n 0x076dc419,\n 0x706af48f,\n 0xe963a535,\n 0x9e6495a3,\n 0x0edb8832,\n 0x79dcb8a4,\n 0xe0d5e91e,\n 0x97d2d988,\n 0x09b64c2b,\n 0x7eb17cbd,\n 0xe7b82d07,\n 0x90bf1d91,\n 0x1db71064,\n 0x6ab020f2,\n 0xf3b97148,\n 0x84be41de,\n 0x1adad47d,\n 0x6ddde4eb,\n 0xf4d4b551,\n 0x83d385c7,\n 0x136c9856,\n 0x646ba8c0,\n 0xfd62f97a,\n 0x8a65c9ec,\n 0x14015c4f,\n 0x63066cd9,\n 0xfa0f3d63,\n 0x8d080df5,\n 0x3b6e20c8,\n 0x4c69105e,\n 0xd56041e4,\n 0xa2677172,\n 0x3c03e4d1,\n 0x4b04d447,\n 0xd20d85fd,\n 0xa50ab56b,\n 0x35b5a8fa,\n 0x42b2986c,\n 0xdbbbc9d6,\n 0xacbcf940,\n 0x32d86ce3,\n 0x45df5c75,\n 0xdcd60dcf,\n 0xabd13d59,\n 0x26d930ac,\n 0x51de003a,\n 0xc8d75180,\n 0xbfd06116,\n 0x21b4f4b5,\n 0x56b3c423,\n 0xcfba9599,\n 0xb8bda50f,\n 0x2802b89e,\n 0x5f058808,\n 0xc60cd9b2,\n 0xb10be924,\n 0x2f6f7c87,\n 0x58684c11,\n 0xc1611dab,\n 0xb6662d3d,\n 0x76dc4190,\n 0x01db7106,\n 0x98d220bc,\n 0xefd5102a,\n 0x71b18589,\n 0x06b6b51f,\n 0x9fbfe4a5,\n 0xe8b8d433,\n 0x7807c9a2,\n 0x0f00f934,\n 0x9609a88e,\n 0xe10e9818,\n 0x7f6a0dbb,\n 0x086d3d2d,\n 0x91646c97,\n 0xe6635c01,\n 0x6b6b51f4,\n 0x1c6c6162,\n 0x856530d8,\n 0xf262004e,\n 0x6c0695ed,\n 0x1b01a57b,\n 0x8208f4c1,\n 0xf50fc457,\n 0x65b0d9c6,\n 0x12b7e950,\n 0x8bbeb8ea,\n 0xfcb9887c,\n 0x62dd1ddf,\n 0x15da2d49,\n 0x8cd37cf3,\n 0xfbd44c65,\n 0x4db26158,\n 0x3ab551ce,\n 0xa3bc0074,\n 0xd4bb30e2,\n 0x4adfa541,\n 0x3dd895d7,\n 0xa4d1c46d,\n 0xd3d6f4fb,\n 0x4369e96a,\n 0x346ed9fc,\n 0xad678846,\n 0xda60b8d0,\n 0x44042d73,\n 0x33031de5,\n 0xaa0a4c5f,\n 0xdd0d7cc9,\n 0x5005713c,\n 0x270241aa,\n 0xbe0b1010,\n 0xc90c2086,\n 0x5768b525,\n 0x206f85b3,\n 0xb966d409,\n 0xce61e49f,\n 0x5edef90e,\n 0x29d9c998,\n 0xb0d09822,\n 0xc7d7a8b4,\n 0x59b33d17,\n 0x2eb40d81,\n 0xb7bd5c3b,\n 0xc0ba6cad,\n 0xedb88320,\n 0x9abfb3b6,\n 0x03b6e20c,\n 0x74b1d29a,\n 0xead54739,\n 0x9dd277af,\n 0x04db2615,\n 0x73dc1683,\n 0xe3630b12,\n 0x94643b84,\n 0x0d6d6a3e,\n 0x7a6a5aa8,\n 0xe40ecf0b,\n 0x9309ff9d,\n 0x0a00ae27,\n 0x7d079eb1,\n 0xf00f9344,\n 0x8708a3d2,\n 0x1e01f268,\n 0x6906c2fe,\n 0xf762575d,\n 0x806567cb,\n 0x196c3671,\n 0x6e6b06e7,\n 0xfed41b76,\n 0x89d32be0,\n 0x10da7a5a,\n 0x67dd4acc,\n 0xf9b9df6f,\n 0x8ebeeff9,\n 0x17b7be43,\n 0x60b08ed5,\n 0xd6d6a3e8,\n 0xa1d1937e,\n 0x38d8c2c4,\n 0x4fdff252,\n 0xd1bb67f1,\n 0xa6bc5767,\n 0x3fb506dd,\n 0x48b2364b,\n 0xd80d2bda,\n 0xaf0a1b4c,\n 0x36034af6,\n 0x41047a60,\n 0xdf60efc3,\n 0xa867df55,\n 0x316e8eef,\n 0x4669be79,\n 0xcb61b38c,\n 0xbc66831a,\n 0x256fd2a0,\n 0x5268e236,\n 0xcc0c7795,\n 0xbb0b4703,\n 0x220216b9,\n 0x5505262f,\n 0xc5ba3bbe,\n 0xb2bd0b28,\n 0x2bb45a92,\n 0x5cb36a04,\n 0xc2d7ffa7,\n 0xb5d0cf31,\n 0x2cd99e8b,\n 0x5bdeae1d,\n 0x9b64c2b0,\n 0xec63f226,\n 0x756aa39c,\n 0x026d930a,\n 0x9c0906a9,\n 0xeb0e363f,\n 0x72076785,\n 0x05005713,\n 0x95bf4a82,\n 0xe2b87a14,\n 0x7bb12bae,\n 0x0cb61b38,\n 0x92d28e9b,\n 0xe5d5be0d,\n 0x7cdcefb7,\n 0x0bdbdf21,\n 0x86d3d2d4,\n 0xf1d4e242,\n 0x68ddb3f8,\n 0x1fda836e,\n 0x81be16cd,\n 0xf6b9265b,\n 0x6fb077e1,\n 0x18b74777,\n 0x88085ae6,\n 0xff0f6a70,\n 0x66063bca,\n 0x11010b5c,\n 0x8f659eff,\n 0xf862ae69,\n 0x616bffd3,\n 0x166ccf45,\n 0xa00ae278,\n 0xd70dd2ee,\n 0x4e048354,\n 0x3903b3c2,\n 0xa7672661,\n 0xd06016f7,\n 0x4969474d,\n 0x3e6e77db,\n 0xaed16a4a,\n 0xd9d65adc,\n 0x40df0b66,\n 0x37d83bf0,\n 0xa9bcae53,\n 0xdebb9ec5,\n 0x47b2cf7f,\n 0x30b5ffe9,\n 0xbdbdf21c,\n 0xcabac28a,\n 0x53b39330,\n 0x24b4a3a6,\n 0xbad03605,\n 0xcdd70693,\n 0x54de5729,\n 0x23d967bf,\n 0xb3667a2e,\n 0xc4614ab8,\n 0x5d681b02,\n 0x2a6f2b94,\n 0xb40bbe37,\n 0xc30c8ea1,\n 0x5a05df1b,\n 0x2d02ef8d\n);\n\nfunction getCRC32Table() {\n return CRC32TAB;\n}\n"],"mappings":"AAUA,eAAe,MAAMA,KAAK,CAAC;EAGzBC,WAAWA,CAAA,EAAG;IAAA,KAFdC,GAAG;IAGD,IAAI,CAACA,GAAG,GAAG,CAAC,CAAC;EACf;EAEAC,MAAMA,CAACC,WAAW,EAAE;IAClB,MAAMC,WAAW,GAAGC,aAAa,CAAC,CAAC;IACnC,MAAMC,SAAS,GAAG,IAAIC,UAAU,CAACJ,WAAW,CAAC;IAC7C,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,SAAS,CAACG,UAAU,EAAED,CAAC,EAAE,EAAE;MAC7C,IAAI,CAACP,GAAG,GAAI,IAAI,CAACA,GAAG,KAAK,CAAC,GAAIG,WAAW,CAAC,CAAC,IAAI,CAACH,GAAG,GAAGK,SAAS,CAACE,CAAC,CAAC,IAAI,IAAI,CAAC;IAE7E;IACA,OAAO,IAAI;EACb;EAEAE,QAAQA,CAAA,EAAG;IAMT,IAAI,CAACT,GAAG,GAAG,CAAC,IAAI,CAACA,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,OAAO,IAAI,CAACA,GAAG;EACjB;AACF;AAGA,MAAMU,QAAQ,GAAGC,WAAW,CAACC,EAAE,CAC7B,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UACF,CAAC;AAED,SAASR,aAAaA,CAAA,EAAG;EACvB,OAAOM,QAAQ;AACjB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"crc32c.js","names":["CRC32C","constructor","options","arguments","length","undefined","crc","update","arrayBuffer","byteArray","Uint8Array","CRC32_TABLE","getCRC32Table","i","finalize","CRC32C_TABLE","Int32Array","of"],"sources":["../../../src/lib/algorithms/crc32c.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// From: https://gist.github.com/wqli78/1330293/6d85cc967f32cccfcbad94ae7d088a3dcfc14bd9\n// CRC32 doesn't appear to be supported natively by crypto-js\n\n// import {toBuffer} from '@loaders.gl/loader-utils';\n// import {calculate as sse4calculate} from 'sse4_crc32';\n\n/**\n * Calculates the CRC32C checksum of a string.\n */\nexport default class CRC32C {\n options;\n crc: number;\n\n constructor(options = {}) {\n this.options = options;\n this.crc = ~0;\n }\n\n update(arrayBuffer) {\n const byteArray = new Uint8Array(arrayBuffer);\n const CRC32_TABLE = getCRC32Table();\n for (let i = 0; i < byteArray.length; i++) {\n this.crc = CRC32_TABLE[(this.crc ^ byteArray[i]) & 0xff] ^ (this.crc >>> 8);\n }\n return this;\n }\n\n finalize() {\n this.crc = (this.crc ^ -1) >>> 0;\n return this.crc;\n }\n}\n\n/**\n * This code is a manual javascript translation of c code generated by\n * pycrc 0.7.1 (http://www.tty1.net/pycrc/). Command line used:\n * './pycrc.py --model=crc-32c --generate c --algorithm=table-driven'\n */\n\n// Note: Using a typed array here doubles the speed of the cipher\nconst CRC32C_TABLE = Int32Array.of(\n 0x00000000,\n 0xf26b8303,\n 0xe13b70f7,\n 0x1350f3f4,\n 0xc79a971f,\n 0x35f1141c,\n 0x26a1e7e8,\n 0xd4ca64eb,\n 0x8ad958cf,\n 0x78b2dbcc,\n 0x6be22838,\n 0x9989ab3b,\n 0x4d43cfd0,\n 0xbf284cd3,\n 0xac78bf27,\n 0x5e133c24,\n 0x105ec76f,\n 0xe235446c,\n 0xf165b798,\n 0x030e349b,\n 0xd7c45070,\n 0x25afd373,\n 0x36ff2087,\n 0xc494a384,\n 0x9a879fa0,\n 0x68ec1ca3,\n 0x7bbcef57,\n 0x89d76c54,\n 0x5d1d08bf,\n 0xaf768bbc,\n 0xbc267848,\n 0x4e4dfb4b,\n 0x20bd8ede,\n 0xd2d60ddd,\n 0xc186fe29,\n 0x33ed7d2a,\n 0xe72719c1,\n 0x154c9ac2,\n 0x061c6936,\n 0xf477ea35,\n 0xaa64d611,\n 0x580f5512,\n 0x4b5fa6e6,\n 0xb93425e5,\n 0x6dfe410e,\n 0x9f95c20d,\n 0x8cc531f9,\n 0x7eaeb2fa,\n 0x30e349b1,\n 0xc288cab2,\n 0xd1d83946,\n 0x23b3ba45,\n 0xf779deae,\n 0x05125dad,\n 0x1642ae59,\n 0xe4292d5a,\n 0xba3a117e,\n 0x4851927d,\n 0x5b016189,\n 0xa96ae28a,\n 0x7da08661,\n 0x8fcb0562,\n 0x9c9bf696,\n 0x6ef07595,\n 0x417b1dbc,\n 0xb3109ebf,\n 0xa0406d4b,\n 0x522bee48,\n 0x86e18aa3,\n 0x748a09a0,\n 0x67dafa54,\n 0x95b17957,\n 0xcba24573,\n 0x39c9c670,\n 0x2a993584,\n 0xd8f2b687,\n 0x0c38d26c,\n 0xfe53516f,\n 0xed03a29b,\n 0x1f682198,\n 0x5125dad3,\n 0xa34e59d0,\n 0xb01eaa24,\n 0x42752927,\n 0x96bf4dcc,\n 0x64d4cecf,\n 0x77843d3b,\n 0x85efbe38,\n 0xdbfc821c,\n 0x2997011f,\n 0x3ac7f2eb,\n 0xc8ac71e8,\n 0x1c661503,\n 0xee0d9600,\n 0xfd5d65f4,\n 0x0f36e6f7,\n 0x61c69362,\n 0x93ad1061,\n 0x80fde395,\n 0x72966096,\n 0xa65c047d,\n 0x5437877e,\n 0x4767748a,\n 0xb50cf789,\n 0xeb1fcbad,\n 0x197448ae,\n 0x0a24bb5a,\n 0xf84f3859,\n 0x2c855cb2,\n 0xdeeedfb1,\n 0xcdbe2c45,\n 0x3fd5af46,\n 0x7198540d,\n 0x83f3d70e,\n 0x90a324fa,\n 0x62c8a7f9,\n 0xb602c312,\n 0x44694011,\n 0x5739b3e5,\n 0xa55230e6,\n 0xfb410cc2,\n 0x092a8fc1,\n 0x1a7a7c35,\n 0xe811ff36,\n 0x3cdb9bdd,\n 0xceb018de,\n 0xdde0eb2a,\n 0x2f8b6829,\n 0x82f63b78,\n 0x709db87b,\n 0x63cd4b8f,\n 0x91a6c88c,\n 0x456cac67,\n 0xb7072f64,\n 0xa457dc90,\n 0x563c5f93,\n 0x082f63b7,\n 0xfa44e0b4,\n 0xe9141340,\n 0x1b7f9043,\n 0xcfb5f4a8,\n 0x3dde77ab,\n 0x2e8e845f,\n 0xdce5075c,\n 0x92a8fc17,\n 0x60c37f14,\n 0x73938ce0,\n 0x81f80fe3,\n 0x55326b08,\n 0xa759e80b,\n 0xb4091bff,\n 0x466298fc,\n 0x1871a4d8,\n 0xea1a27db,\n 0xf94ad42f,\n 0x0b21572c,\n 0xdfeb33c7,\n 0x2d80b0c4,\n 0x3ed04330,\n 0xccbbc033,\n 0xa24bb5a6,\n 0x502036a5,\n 0x4370c551,\n 0xb11b4652,\n 0x65d122b9,\n 0x97baa1ba,\n 0x84ea524e,\n 0x7681d14d,\n 0x2892ed69,\n 0xdaf96e6a,\n 0xc9a99d9e,\n 0x3bc21e9d,\n 0xef087a76,\n 0x1d63f975,\n 0x0e330a81,\n 0xfc588982,\n 0xb21572c9,\n 0x407ef1ca,\n 0x532e023e,\n 0xa145813d,\n 0x758fe5d6,\n 0x87e466d5,\n 0x94b49521,\n 0x66df1622,\n 0x38cc2a06,\n 0xcaa7a905,\n 0xd9f75af1,\n 0x2b9cd9f2,\n 0xff56bd19,\n 0x0d3d3e1a,\n 0x1e6dcdee,\n 0xec064eed,\n 0xc38d26c4,\n 0x31e6a5c7,\n 0x22b65633,\n 0xd0ddd530,\n 0x0417b1db,\n 0xf67c32d8,\n 0xe52cc12c,\n 0x1747422f,\n 0x49547e0b,\n 0xbb3ffd08,\n 0xa86f0efc,\n 0x5a048dff,\n 0x8ecee914,\n 0x7ca56a17,\n 0x6ff599e3,\n 0x9d9e1ae0,\n 0xd3d3e1ab,\n 0x21b862a8,\n 0x32e8915c,\n 0xc083125f,\n 0x144976b4,\n 0xe622f5b7,\n 0xf5720643,\n 0x07198540,\n 0x590ab964,\n 0xab613a67,\n 0xb831c993,\n 0x4a5a4a90,\n 0x9e902e7b,\n 0x6cfbad78,\n 0x7fab5e8c,\n 0x8dc0dd8f,\n 0xe330a81a,\n 0x115b2b19,\n 0x020bd8ed,\n 0xf0605bee,\n 0x24aa3f05,\n 0xd6c1bc06,\n 0xc5914ff2,\n 0x37faccf1,\n 0x69e9f0d5,\n 0x9b8273d6,\n 0x88d28022,\n 0x7ab90321,\n 0xae7367ca,\n 0x5c18e4c9,\n 0x4f48173d,\n 0xbd23943e,\n 0xf36e6f75,\n 0x0105ec76,\n 0x12551f82,\n 0xe03e9c81,\n 0x34f4f86a,\n 0xc69f7b69,\n 0xd5cf889d,\n 0x27a40b9e,\n 0x79b737ba,\n 0x8bdcb4b9,\n 0x988c474d,\n 0x6ae7c44e,\n 0xbe2da0a5,\n 0x4c4623a6,\n 0x5f16d052,\n 0xad7d5351\n);\n\nfunction getCRC32Table() {\n return CRC32C_TABLE;\n}\n"],"mappings":"AAaA,eAAe,MAAMA,MAAM,CAAC;EAI1BC,WAAWA,CAAA,EAAe;IAAA,IAAdC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAAA,KAHxBD,OAAO;IAAA,KACPI,GAAG;IAGD,IAAI,CAACJ,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACI,GAAG,GAAG,CAAC,CAAC;EACf;EAEAC,MAAMA,CAACC,WAAW,EAAE;IAClB,MAAMC,SAAS,GAAG,IAAIC,UAAU,CAACF,WAAW,CAAC;IAC7C,MAAMG,WAAW,GAAGC,aAAa,CAAC,CAAC;IACnC,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,SAAS,CAACL,MAAM,EAAES,CAAC,EAAE,EAAE;MACzC,IAAI,CAACP,GAAG,GAAGK,WAAW,CAAC,CAAC,IAAI,CAACL,GAAG,GAAGG,SAAS,CAACI,CAAC,CAAC,IAAI,IAAI,CAAC,GAAI,IAAI,CAACP,GAAG,KAAK,CAAE;IAC7E;IACA,OAAO,IAAI;EACb;EAEAQ,QAAQA,CAAA,EAAG;IACT,IAAI,CAACR,GAAG,GAAG,CAAC,IAAI,CAACA,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,OAAO,IAAI,CAACA,GAAG;EACjB;AACF;AASA,MAAMS,YAAY,GAAGC,UAAU,CAACC,EAAE,CAChC,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UACF,CAAC;AAED,SAASL,aAAaA,CAAA,EAAG;EACvB,OAAOG,YAAY;AACrB"}