wasm-hash

1.1.1 • Public • Published

基于WASM计算文件md5的工具

使用WebAssembly计算string或者ArrayBuffer的hash值,可以快速计算文件的md5值.

使用方式

  1. npm安装
npm install wasm-hash 
  1. 项目使用
import Hash from 'wasm-hash';

//单个分片计算
const hash = new Hash('md5');
const md5 = hash.update(arrayBuffer).toString();



//整个文件计算,将切好的arrayBuffer数组直接传给end即可

const hash = new Hash('md5');
hash.end(arrayBuffers,(md5) => {
    resolve({fileMd5: md5});
})

环比提升(因系统环境,可能存在差异,仅供参考)

Readme

Keywords

Package Sidebar

Install

npm i wasm-hash

Weekly Downloads

9

Version

1.1.1

License

ISC

Unpacked Size

9.04 kB

Total Files

4

Last publish

Collaborators

  • xjhuge