@aws-amplify/storage 6.8.5-unstable.3c4d29e.0 → 6.8.5-unstable.7d58598.0

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 (73) hide show
  1. package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/initialUpload.js +13 -3
  2. package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/initialUpload.js.map +1 -1
  3. package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/uploadCache.js +21 -10
  4. package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/uploadCache.js.map +1 -1
  5. package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/uploadHandlers.js +5 -2
  6. package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/uploadHandlers.js.map +1 -1
  7. package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/uploadPartExecutor.js +2 -2
  8. package/dist/cjs/providers/s3/apis/internal/uploadData/multipart/uploadPartExecutor.js.map +1 -1
  9. package/dist/cjs/providers/s3/apis/internal/uploadData/putObjectJob.js +1 -1
  10. package/dist/cjs/providers/s3/apis/internal/uploadData/putObjectJob.js.map +1 -1
  11. package/dist/cjs/providers/s3/utils/client/s3data/completeMultipartUpload.js +1 -0
  12. package/dist/cjs/providers/s3/utils/client/s3data/completeMultipartUpload.js.map +1 -1
  13. package/dist/cjs/providers/s3/utils/client/s3data/createMultipartUpload.js +1 -0
  14. package/dist/cjs/providers/s3/utils/client/s3data/createMultipartUpload.js.map +1 -1
  15. package/dist/cjs/providers/s3/utils/client/s3data/getObject.js +1 -0
  16. package/dist/cjs/providers/s3/utils/client/s3data/getObject.js.map +1 -1
  17. package/dist/cjs/providers/s3/utils/client/s3data/listObjectsV2.js +1 -0
  18. package/dist/cjs/providers/s3/utils/client/s3data/listObjectsV2.js.map +1 -1
  19. package/dist/cjs/providers/s3/utils/crc32.js +4 -5
  20. package/dist/cjs/providers/s3/utils/crc32.js.map +1 -1
  21. package/dist/cjs/providers/s3/utils/hexUtils.js +1 -3
  22. package/dist/cjs/providers/s3/utils/hexUtils.js.map +1 -1
  23. package/dist/esm/providers/s3/apis/internal/uploadData/multipart/initialUpload.mjs +14 -4
  24. package/dist/esm/providers/s3/apis/internal/uploadData/multipart/initialUpload.mjs.map +1 -1
  25. package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadCache.d.ts +1 -1
  26. package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadCache.mjs +20 -9
  27. package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadCache.mjs.map +1 -1
  28. package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadHandlers.mjs +5 -2
  29. package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadHandlers.mjs.map +1 -1
  30. package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadPartExecutor.mjs +2 -2
  31. package/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadPartExecutor.mjs.map +1 -1
  32. package/dist/esm/providers/s3/apis/internal/uploadData/putObjectJob.mjs +1 -1
  33. package/dist/esm/providers/s3/apis/internal/uploadData/putObjectJob.mjs.map +1 -1
  34. package/dist/esm/providers/s3/utils/client/s3data/completeMultipartUpload.d.ts +1 -1
  35. package/dist/esm/providers/s3/utils/client/s3data/completeMultipartUpload.mjs +1 -0
  36. package/dist/esm/providers/s3/utils/client/s3data/completeMultipartUpload.mjs.map +1 -1
  37. package/dist/esm/providers/s3/utils/client/s3data/createMultipartUpload.d.ts +2 -2
  38. package/dist/esm/providers/s3/utils/client/s3data/createMultipartUpload.mjs +1 -0
  39. package/dist/esm/providers/s3/utils/client/s3data/createMultipartUpload.mjs.map +1 -1
  40. package/dist/esm/providers/s3/utils/client/s3data/getObject.mjs +1 -0
  41. package/dist/esm/providers/s3/utils/client/s3data/getObject.mjs.map +1 -1
  42. package/dist/esm/providers/s3/utils/client/s3data/listObjectsV2.mjs +1 -0
  43. package/dist/esm/providers/s3/utils/client/s3data/listObjectsV2.mjs.map +1 -1
  44. package/dist/esm/providers/s3/utils/crc32.d.ts +4 -6
  45. package/dist/esm/providers/s3/utils/crc32.mjs +5 -6
  46. package/dist/esm/providers/s3/utils/crc32.mjs.map +1 -1
  47. package/dist/esm/providers/s3/utils/hexUtils.d.ts +0 -1
  48. package/dist/esm/providers/s3/utils/hexUtils.mjs +1 -2
  49. package/dist/esm/providers/s3/utils/hexUtils.mjs.map +1 -1
  50. package/package.json +5 -5
  51. package/src/providers/s3/apis/internal/uploadData/multipart/initialUpload.ts +14 -4
  52. package/src/providers/s3/apis/internal/uploadData/multipart/uploadCache.ts +30 -10
  53. package/src/providers/s3/apis/internal/uploadData/multipart/uploadHandlers.ts +5 -2
  54. package/src/providers/s3/apis/internal/uploadData/multipart/uploadPartExecutor.ts +4 -4
  55. package/src/providers/s3/apis/internal/uploadData/putObjectJob.ts +1 -1
  56. package/src/providers/s3/utils/client/s3data/completeMultipartUpload.ts +2 -0
  57. package/src/providers/s3/utils/client/s3data/createMultipartUpload.ts +3 -1
  58. package/src/providers/s3/utils/client/s3data/getObject.ts +1 -0
  59. package/src/providers/s3/utils/client/s3data/listObjectsV2.ts +2 -0
  60. package/src/providers/s3/utils/crc32.ts +6 -13
  61. package/src/providers/s3/utils/hexUtils.ts +0 -3
  62. package/dist/cjs/providers/s3/utils/getCombinedCrc32.js +0 -31
  63. package/dist/cjs/providers/s3/utils/getCombinedCrc32.js.map +0 -1
  64. package/dist/cjs/providers/s3/utils/getCombinedCrc32.native.js +0 -40
  65. package/dist/cjs/providers/s3/utils/getCombinedCrc32.native.js.map +0 -1
  66. package/dist/esm/providers/s3/utils/getCombinedCrc32.d.ts +0 -14
  67. package/dist/esm/providers/s3/utils/getCombinedCrc32.mjs +0 -29
  68. package/dist/esm/providers/s3/utils/getCombinedCrc32.mjs.map +0 -1
  69. package/dist/esm/providers/s3/utils/getCombinedCrc32.native.d.ts +0 -14
  70. package/dist/esm/providers/s3/utils/getCombinedCrc32.native.mjs +0 -38
  71. package/dist/esm/providers/s3/utils/getCombinedCrc32.native.mjs.map +0 -1
  72. package/src/providers/s3/utils/getCombinedCrc32.native.ts +0 -46
  73. package/src/providers/s3/utils/getCombinedCrc32.ts +0 -34
@@ -1,40 +0,0 @@
1
- 'use strict';
2
-
3
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
- // SPDX-License-Identifier: Apache-2.0
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getCombinedCrc32 = void 0;
7
- const getDataChunker_1 = require("../apis/internal/uploadData/multipart/getDataChunker");
8
- const crc32_1 = require("./crc32");
9
- /**
10
- * Calculates a combined CRC32 checksum for the given data.
11
- *
12
- * This function chunks the input data, calculates CRC32 for each chunk,
13
- * and then combines these checksums into a single value.
14
- *
15
- * @async
16
- * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.
17
- * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.
18
- * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum
19
- * and the number of chunks, separated by a hyphen.
20
- */
21
- const getCombinedCrc32 = async (data, size) => {
22
- const crc32List = [];
23
- const dataChunker = (0, getDataChunker_1.getDataChunker)(data, size);
24
- let totalLength = 0;
25
- for (const { data: checkData } of dataChunker) {
26
- const checksum = new Uint8Array((await (0, crc32_1.calculateContentCRC32)(checkData)).checksumArrayBuffer);
27
- totalLength += checksum.length;
28
- crc32List.push(checksum);
29
- }
30
- // Combine all Uint8Arrays into a single Uint8Array
31
- const combinedArray = new Uint8Array(totalLength);
32
- let offset = 0;
33
- for (const crc32Hash of crc32List) {
34
- combinedArray.set(crc32Hash, offset);
35
- offset += crc32Hash.length;
36
- }
37
- return `${(await (0, crc32_1.calculateContentCRC32)(combinedArray.buffer)).checksum}-${crc32List.length}`;
38
- };
39
- exports.getCombinedCrc32 = getCombinedCrc32;
40
- //# sourceMappingURL=getCombinedCrc32.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCombinedCrc32.native.js","sources":["../../../../../src/providers/s3/utils/getCombinedCrc32.native.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getCombinedCrc32 = void 0;\nconst getDataChunker_1 = require(\"../apis/internal/uploadData/multipart/getDataChunker\");\nconst crc32_1 = require(\"./crc32\");\n/**\n * Calculates a combined CRC32 checksum for the given data.\n *\n * This function chunks the input data, calculates CRC32 for each chunk,\n * and then combines these checksums into a single value.\n *\n * @async\n * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.\n * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.\n * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum\n * and the number of chunks, separated by a hyphen.\n */\nconst getCombinedCrc32 = async (data, size) => {\n const crc32List = [];\n const dataChunker = (0, getDataChunker_1.getDataChunker)(data, size);\n let totalLength = 0;\n for (const { data: checkData } of dataChunker) {\n const checksum = new Uint8Array((await (0, crc32_1.calculateContentCRC32)(checkData)).checksumArrayBuffer);\n totalLength += checksum.length;\n crc32List.push(checksum);\n }\n // Combine all Uint8Arrays into a single Uint8Array\n const combinedArray = new Uint8Array(totalLength);\n let offset = 0;\n for (const crc32Hash of crc32List) {\n combinedArray.set(crc32Hash, offset);\n offset += crc32Hash.length;\n }\n return `${(await (0, crc32_1.calculateContentCRC32)(combinedArray.buffer)).checksum}-${crc32List.length}`;\n};\nexports.getCombinedCrc32 = getCombinedCrc32;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,gBAAgB,GAAG,MAAM;AACjC,MAAM,gBAAgB,GAAG,OAAO,CAAC,sDAAsD,CAAC;AACxF,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,gBAAgB,GAAG,OAAO,IAAI,EAAE,IAAI,KAAK;AAC/C,IAAI,MAAM,SAAS,GAAG,EAAE;AACxB,IAAI,MAAM,WAAW,GAAG,IAAI,gBAAgB,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC;AACxE,IAAI,IAAI,WAAW,GAAG,CAAC;AACvB,IAAI,KAAK,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,WAAW,EAAE;AACnD,QAAQ,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,CAAC,MAAM,IAAI,OAAO,CAAC,qBAAqB,EAAE,SAAS,CAAC,EAAE,mBAAmB,CAAC;AAClH,QAAQ,WAAW,IAAI,QAAQ,CAAC,MAAM;AACtC,QAAQ,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;AAChC;AACA;AACA,IAAI,MAAM,aAAa,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC;AACrD,IAAI,IAAI,MAAM,GAAG,CAAC;AAClB,IAAI,KAAK,MAAM,SAAS,IAAI,SAAS,EAAE;AACvC,QAAQ,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC;AAC5C,QAAQ,MAAM,IAAI,SAAS,CAAC,MAAM;AAClC;AACA,IAAI,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,OAAO,CAAC,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;AAC7G,CAAC;AACD,OAAO,CAAC,gBAAgB,GAAG,gBAAgB;;"}
@@ -1,14 +0,0 @@
1
- import { StorageUploadDataPayload } from '../../../types';
2
- /**
3
- * Calculates a combined CRC32 checksum for the given data.
4
- *
5
- * This function chunks the input data, calculates CRC32 for each chunk,
6
- * and then combines these checksums into a single value.
7
- *
8
- * @async
9
- * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.
10
- * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.
11
- * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum
12
- * and the number of chunks, separated by a hyphen.
13
- */
14
- export declare const getCombinedCrc32: (data: StorageUploadDataPayload, size: number | undefined) => Promise<string>;
@@ -1,29 +0,0 @@
1
- import { getDataChunker } from '../apis/internal/uploadData/multipart/getDataChunker.mjs';
2
- import { calculateContentCRC32 } from './crc32.mjs';
3
-
4
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
- // SPDX-License-Identifier: Apache-2.0
6
- /**
7
- * Calculates a combined CRC32 checksum for the given data.
8
- *
9
- * This function chunks the input data, calculates CRC32 for each chunk,
10
- * and then combines these checksums into a single value.
11
- *
12
- * @async
13
- * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.
14
- * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.
15
- * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum
16
- * and the number of chunks, separated by a hyphen.
17
- */
18
- const getCombinedCrc32 = async (data, size) => {
19
- const crc32List = [];
20
- const dataChunker = getDataChunker(data, size);
21
- for (const { data: checkData } of dataChunker) {
22
- const { checksumArrayBuffer } = await calculateContentCRC32(checkData);
23
- crc32List.push(checksumArrayBuffer);
24
- }
25
- return `${(await calculateContentCRC32(new Blob(crc32List))).checksum}-${crc32List.length}`;
26
- };
27
-
28
- export { getCombinedCrc32 };
29
- //# sourceMappingURL=getCombinedCrc32.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCombinedCrc32.mjs","sources":["../../../../../src/providers/s3/utils/getCombinedCrc32.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getDataChunker } from '../apis/internal/uploadData/multipart/getDataChunker';\nimport { calculateContentCRC32 } from './crc32';\n/**\n * Calculates a combined CRC32 checksum for the given data.\n *\n * This function chunks the input data, calculates CRC32 for each chunk,\n * and then combines these checksums into a single value.\n *\n * @async\n * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.\n * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.\n * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum\n * and the number of chunks, separated by a hyphen.\n */\nexport const getCombinedCrc32 = async (data, size) => {\n const crc32List = [];\n const dataChunker = getDataChunker(data, size);\n for (const { data: checkData } of dataChunker) {\n const { checksumArrayBuffer } = await calculateContentCRC32(checkData);\n crc32List.push(checksumArrayBuffer);\n }\n return `${(await calculateContentCRC32(new Blob(crc32List))).checksum}-${crc32List.length}`;\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,gBAAgB,GAAG,OAAO,IAAI,EAAE,IAAI,KAAK;AACtD,IAAI,MAAM,SAAS,GAAG,EAAE;AACxB,IAAI,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;AAClD,IAAI,KAAK,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,WAAW,EAAE;AACnD,QAAQ,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,qBAAqB,CAAC,SAAS,CAAC;AAC9E,QAAQ,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC;AAC3C;AACA,IAAI,OAAO,CAAC,EAAE,CAAC,MAAM,qBAAqB,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;AAC/F;;;;"}
@@ -1,14 +0,0 @@
1
- import { StorageUploadDataPayload } from '../../../types';
2
- /**
3
- * Calculates a combined CRC32 checksum for the given data.
4
- *
5
- * This function chunks the input data, calculates CRC32 for each chunk,
6
- * and then combines these checksums into a single value.
7
- *
8
- * @async
9
- * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.
10
- * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.
11
- * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum
12
- * and the number of chunks, separated by a hyphen.
13
- */
14
- export declare const getCombinedCrc32: (data: StorageUploadDataPayload, size: number | undefined) => Promise<string>;
@@ -1,38 +0,0 @@
1
- import { getDataChunker } from '../apis/internal/uploadData/multipart/getDataChunker.mjs';
2
- import { calculateContentCRC32 } from './crc32.mjs';
3
-
4
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
- // SPDX-License-Identifier: Apache-2.0
6
- /**
7
- * Calculates a combined CRC32 checksum for the given data.
8
- *
9
- * This function chunks the input data, calculates CRC32 for each chunk,
10
- * and then combines these checksums into a single value.
11
- *
12
- * @async
13
- * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.
14
- * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.
15
- * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum
16
- * and the number of chunks, separated by a hyphen.
17
- */
18
- const getCombinedCrc32 = async (data, size) => {
19
- const crc32List = [];
20
- const dataChunker = getDataChunker(data, size);
21
- let totalLength = 0;
22
- for (const { data: checkData } of dataChunker) {
23
- const checksum = new Uint8Array((await calculateContentCRC32(checkData)).checksumArrayBuffer);
24
- totalLength += checksum.length;
25
- crc32List.push(checksum);
26
- }
27
- // Combine all Uint8Arrays into a single Uint8Array
28
- const combinedArray = new Uint8Array(totalLength);
29
- let offset = 0;
30
- for (const crc32Hash of crc32List) {
31
- combinedArray.set(crc32Hash, offset);
32
- offset += crc32Hash.length;
33
- }
34
- return `${(await calculateContentCRC32(combinedArray.buffer)).checksum}-${crc32List.length}`;
35
- };
36
-
37
- export { getCombinedCrc32 };
38
- //# sourceMappingURL=getCombinedCrc32.native.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCombinedCrc32.native.mjs","sources":["../../../../../src/providers/s3/utils/getCombinedCrc32.native.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getDataChunker } from '../apis/internal/uploadData/multipart/getDataChunker';\nimport { calculateContentCRC32 } from './crc32';\n/**\n * Calculates a combined CRC32 checksum for the given data.\n *\n * This function chunks the input data, calculates CRC32 for each chunk,\n * and then combines these checksums into a single value.\n *\n * @async\n * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.\n * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.\n * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum\n * and the number of chunks, separated by a hyphen.\n */\nexport const getCombinedCrc32 = async (data, size) => {\n const crc32List = [];\n const dataChunker = getDataChunker(data, size);\n let totalLength = 0;\n for (const { data: checkData } of dataChunker) {\n const checksum = new Uint8Array((await calculateContentCRC32(checkData)).checksumArrayBuffer);\n totalLength += checksum.length;\n crc32List.push(checksum);\n }\n // Combine all Uint8Arrays into a single Uint8Array\n const combinedArray = new Uint8Array(totalLength);\n let offset = 0;\n for (const crc32Hash of crc32List) {\n combinedArray.set(crc32Hash, offset);\n offset += crc32Hash.length;\n }\n return `${(await calculateContentCRC32(combinedArray.buffer)).checksum}-${crc32List.length}`;\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,gBAAgB,GAAG,OAAO,IAAI,EAAE,IAAI,KAAK;AACtD,IAAI,MAAM,SAAS,GAAG,EAAE;AACxB,IAAI,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC;AAClD,IAAI,IAAI,WAAW,GAAG,CAAC;AACvB,IAAI,KAAK,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,WAAW,EAAE;AACnD,QAAQ,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,CAAC,MAAM,qBAAqB,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC;AACrG,QAAQ,WAAW,IAAI,QAAQ,CAAC,MAAM;AACtC,QAAQ,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;AAChC;AACA;AACA,IAAI,MAAM,aAAa,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC;AACrD,IAAI,IAAI,MAAM,GAAG,CAAC;AAClB,IAAI,KAAK,MAAM,SAAS,IAAI,SAAS,EAAE;AACvC,QAAQ,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC;AAC5C,QAAQ,MAAM,IAAI,SAAS,CAAC,MAAM;AAClC;AACA,IAAI,OAAO,CAAC,EAAE,CAAC,MAAM,qBAAqB,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;AAChG;;;;"}
@@ -1,46 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import { StorageUploadDataPayload } from '../../../types';
5
- import { getDataChunker } from '../apis/internal/uploadData/multipart/getDataChunker';
6
-
7
- import { calculateContentCRC32 } from './crc32';
8
-
9
- /**
10
- * Calculates a combined CRC32 checksum for the given data.
11
- *
12
- * This function chunks the input data, calculates CRC32 for each chunk,
13
- * and then combines these checksums into a single value.
14
- *
15
- * @async
16
- * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.
17
- * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.
18
- * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum
19
- * and the number of chunks, separated by a hyphen.
20
- */
21
- export const getCombinedCrc32 = async (
22
- data: StorageUploadDataPayload,
23
- size: number | undefined,
24
- ) => {
25
- const crc32List: Uint8Array[] = [];
26
- const dataChunker = getDataChunker(data, size);
27
-
28
- let totalLength = 0;
29
- for (const { data: checkData } of dataChunker) {
30
- const checksum = new Uint8Array(
31
- (await calculateContentCRC32(checkData)).checksumArrayBuffer,
32
- );
33
- totalLength += checksum.length;
34
- crc32List.push(checksum);
35
- }
36
-
37
- // Combine all Uint8Arrays into a single Uint8Array
38
- const combinedArray = new Uint8Array(totalLength);
39
- let offset = 0;
40
- for (const crc32Hash of crc32List) {
41
- combinedArray.set(crc32Hash, offset);
42
- offset += crc32Hash.length;
43
- }
44
-
45
- return `${(await calculateContentCRC32(combinedArray.buffer)).checksum}-${crc32List.length}`;
46
- };
@@ -1,34 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import { StorageUploadDataPayload } from '../../../types';
5
- import { getDataChunker } from '../apis/internal/uploadData/multipart/getDataChunker';
6
-
7
- import { calculateContentCRC32 } from './crc32';
8
-
9
- /**
10
- * Calculates a combined CRC32 checksum for the given data.
11
- *
12
- * This function chunks the input data, calculates CRC32 for each chunk,
13
- * and then combines these checksums into a single value.
14
- *
15
- * @async
16
- * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.
17
- * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.
18
- * @returns {Promise<string>} A promise that resolves to a string containing the combined CRC32 checksum
19
- * and the number of chunks, separated by a hyphen.
20
- */
21
- export const getCombinedCrc32 = async (
22
- data: StorageUploadDataPayload,
23
- size: number | undefined,
24
- ) => {
25
- const crc32List: ArrayBuffer[] = [];
26
- const dataChunker = getDataChunker(data, size);
27
- for (const { data: checkData } of dataChunker) {
28
- const { checksumArrayBuffer } = await calculateContentCRC32(checkData);
29
-
30
- crc32List.push(checksumArrayBuffer);
31
- }
32
-
33
- return `${(await calculateContentCRC32(new Blob(crc32List))).checksum}-${crc32List.length}`;
34
- };