This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hash-wasm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
hash-wasm
Hash-WASM is a fast and portable hash function library.
It's using WebAssembly to calculate the hash faster than other JavaScript-based implementations.
In this way, multiple hashes can be calculated parallelly without interference between the hash states.
* Chunked input syntax creates new WASM instances, with separate state.
This might cause to run a bit slower compared to shorthand functions like md5(), which are reusing the same WASM instance and state to do multiple calculations.
Browser support
Chrome
Safari
Firefox
Edge
IE
57+
11+
53+
16+
Not supported
Benchmark
MD5
ops/s
throughput
node.js crypto module
213
852 MB/s
hash-wasm
137
548 MB/s
node-forge (npm library)
20
80 MB/s
md5 (npm library)
2
8 MB/s
MD4
ops/s
throughput
node.js crypto module
351
1404 MB/s
hash-wasm
247
988 MB/s
js-md4 (npm library)
94
376 MB/s
CRC32
ops/s
throughput
hash-wasm
471
1884 MB/s
crc (npm library)
131
524 MB/s
SHA1
ops/s
throughput
node.js crypto module
266
1064 MB/s
hash-wasm
128
512 MB/s
node-forge (npm library)
23
92 MB/s
jsSHA (npm library)
13
52 MB/s
crypto-js (npm library)
6
24 MB/s
sha1 (npm library)
2
8 MB/s
SHA256
ops/s
throughput
node.js crypto module
120
480 MB/s
hash-wasm
56
224 MB/s
sha256-wasm (npm library)
27
108 MB/s
node-forge (npm library)
17
68 MB/s
jsSHA (npm library)
10
40 MB/s
crypto-js (npm library)
6
24 MB/s
SHA512
ops/s
throughput
node.js crypto module
171
684 MB/s
hash-wasm
79
316 MB/s
node-forge (npm library)
11
44 MB/s
jsSHA (npm library)
2
8 MB/s
crypto-js (npm library)
1
4 MB/s
SHA3-512
ops/s
throughput
node.js crypto module
61
244 MB/s
hash-wasm
40
160 MB/s
sha3 (npm library)
2
8 MB/s
jsSHA (npm library)
0
< 4 MB/s
XXHash64
ops/s
throughput
xxhash (node.js binding)
3 852
15 408 MB/s
hash-wasm
1 354
5 416 MB/s
xxhash-wasm (npm library)
59
236 MB/s
xxhashjs (npm library)
3
12 MB/s
* Benchmarks can be started with the npm run benchmark command. These measurements were made using Node.js v12.16.2 by hashing a fixed input buffer (size = 4MB).