Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const calculateSha256: StreamHasher = async function calculateSha256(
hashCtor: HashConstructor,
blob: Blob
): Promise {
const hash = new hashCtor();
await blobReader(blob, chunk => {
hash.update(chunk);
});
return hash.digest();
};