@aws-amplify/storage
Version:
Storage category of aws-amplify
1 lines • 959 B
Source Map (JSON)
{"version":3,"file":"md5.mjs","sources":["../../../../../src/providers/s3/utils/md5.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Md5 } from '@smithy/md5-js';\nimport { toBase64 } from './client/utils';\nimport { readFile } from './readFile';\nexport const calculateContentMd5 = async (content) => {\n const hasher = new Md5();\n const buffer = content instanceof Blob ? await readFile(content) : content;\n hasher.update(buffer);\n const digest = await hasher.digest();\n return toBase64(digest);\n};\n"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AAIY,MAAC,mBAAmB,GAAG,OAAO,OAAO,KAAK;AACtD,IAAI,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE;AAC5B,IAAI,MAAM,MAAM,GAAG,OAAO,YAAY,IAAI,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,GAAG,OAAO;AAC9E,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AACzB,IAAI,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE;AACxC,IAAI,OAAO,QAAQ,CAAC,MAAM,CAAC;AAC3B;;;;"}