Skip to content

v0.5.2

Choose a tag to compare

@bddjr bddjr released this 12 Sep 09:39
· 24 commits to main since this release
3c0162e

943 Bytes (-12)

  • ⚡ Optimize & Eliminate JIT Deopt: Simplified inputToWords and output formatting. Replaced the old big-endian JS bitwise loop with native TypedArray .reverse(), completely eliminating JIT deoptimization (bailout) risks and keeping type feedback clean and monomorphic.
  • 📊 Benchmark:
    • Added spark-md5 to benchmarks.
    • Fixed js-md5 silently delegating to node:crypto in Node.js, ensuring a fair pure-JS benchmark.
    • tinyhmacmd5 remains the fastest pure-JS MD5 / HMAC-MD5 implementation.
  • 📝 Updated package description: "A tiny, fast and reliable implementation of MD5 and HMAC-MD5 for JavaScript."
> pnpm benchmark
$ node scripts/benchmark.mjs && node scripts/test-513MiB.mjs
Data length: 104857600 chars (100MiB)
--------------------------------------------------
tinyhmacmd5     : 388.45 ms
spark-md5       : 520.13 ms
js-md5          : 480.29 ms
crypto-js       : 1661.32 ms
blueimp-md5     : 3749.15 ms
node:crypto     : 129.97 ms
--------------------------------------------------
✅ All pure JS implementations match node:crypto result.

--- Pure 513MiB Test (No prior small tests) ---
tinyhmacmd5 HMAC-MD5 timer: 1.867s
node:crypto HMAC-MD5 timer: 548.332ms
tinyhmacmd5 MD5 timer: 1.869s
node:crypto MD5 timer: 551.244ms

Full Changelog: v0.5.1...v0.5.2