computed data hash by webAssembly
The difference with github.com/fuyoo/wasm-hasher
AbortSignal
onProgress
callback is optional. Set to null
to improve performance if you don't need it.import * as hasher from "@axetroy/wasm-hasher";
const controller = new AbortController();
const file = new Blob([], { type: "application/text" });
const md5 = await hasher.md5(
controller.signal,
file,
1024 * 1024 * 10,
(progress) => {
console.log("hash progress");
}
);
console.log(md5);
npm install @axetroy/wasm-hasher
npm install @axetroy/wasm-hasher-md5
npm install @axetroy/wasm-hasher-sha1
npm install @axetroy/wasm-hasher-sha2
npm install @axetroy/wasm-hasher-sha3
npm install @axetroy/wasm-hasher-sm3
npm install @axetroy/wasm-hasher-ripemd
npm install @axetroy/wasm-hasher-tiger
npm install @axetroy/wasm-hasher-whirlpool
npm install @axetroy/wasm-hasher-blake
Make sure you have install rust^1.69 and wasm-pack
make