UNPKG

serverless-spy

Version:

CDK-based library for writing elegant integration tests on AWS serverless architecture and an additional web console to monitor events in real time.

9 lines (8 loc) 266 B
import { blobReader } from "@smithy/chunked-blob-reader"; export const blobHasher = async function blobHasher(hashCtor, blob) { const hash = new hashCtor(); await blobReader(blob, (chunk) => { hash.update(chunk); }); return hash.digest(); };