3 ms·
It's a custom solution, but nothing special just incremental hashing for large files. I took off the shelf wasm crypto libraries to compare it, but the leading
by theultdev 5mo ago
It's a custom solution, but nothing special just incremental hashing for large files.
I took off the shelf wasm crypto libraries to compare it, but the leading one was 10x slower.
- throawayonthe 5mo agocan we see?
- theultdev 5mo agoyeah check back at the end of the day. will try to rip it out of the project and put it in a standalone benchmark.
- titzer 5mo agoIt'd be interesting to compare it to a SHA-256 algorithm that uses Wasm simd: https://github.com/ChrisWhealy/wasm_sha256 https://github.com/ChrisWhealy/wasm_sha256
- theultdev 5mo agoNoted, will add that. Last time I tried https://github.com/Daninet/hash-wasm https://github.com/Daninet/hash-wasm edit: I focus on browsers, that's wasm but not for browser envs. ---- https://theultdev.github.io/web-sha256-benchmark https://theultdev.github.io/web-sha256-benchmark https://github.com/TheUltDev/web-sha256-benchmark https://github.com/TheUltDev/web-sha256-benchmark seems it is chrome wasm that is slow. asmjs is about the same speed in chrome and firefox (with asm optimizations still enabled) but wasm is slow as hell in chrome, asm still better. side note: someone mentioned native crypto.subtle, but that doesn't have incremental hashing so can't use it for large files. however I do use it in practice for smaller files.