UNPKG

qsu

Version:

qsu is a utility library that contains useful and frequently used functions. Start with your preferred language and the modern development environment.

1 lines 237 B
import{createHash as r}from"crypto";import{pipeline as t}from"stream/promises";export async function getFileHashFromStream(e,o="md5"){if(!e)throw new Error("Invalid file stream detected");const i=r(o);return await t(e,i),i.digest("hex")}