Repository navigation
Releases: bddjr/tinyhmacmd5
Releases · bddjr/tinyhmacmd5
Release list
v0.5.3-es2026
v0.5.3
926 Bytes (-17)
⚡ Performance & TurboFan JIT Optimization
- Native
RORRecognition: Migrated bit rotation from ROL to ROR (>>> cnt | a << 32 - cnt) with updated shift string table"94/*;72,<50):61+". This allows V8 TurboFan to natively recognize the rotation pattern and emit a single x86rorlinstruction instead of multiple shift/or instructions. - Loop-Invariant Register Hoisting (
mul&add): Hoisted round multiplier and adder calculations (let mul = 0x7351 >> l, add = 0x0510 >> l) directly into the innerforheader. This eliminates 4 shift instructions and memory loads per step in the hot loop, ensuring optimal register allocation and yielding an immediate speedup. - Inlined Endianness Check (
reverseOnBE): Inlined theisBEcheck directly intoreverseOnBE(a => isBE ? a.reverse() : a) instead of writingisBE &&before every call site, enabling cleaner expression nesting and saving code size.
🧩 Expanded Input Types
- Added official support for
Int8Arrayandnumber[]inputs in both MD5 and HMAC-MD5 (elements are safely cast to bytes viaUint8Array). - Updated TypeScript declarations (
main.d.ts), JSDoc (@typedef Input), andREADME.mdwith usage examples.
🛠️ Tooling & Dependencies
- Updated
terserto^5.51.2andes-checkto^9.7.1. - Added
tsconfig.nocheck.jsoncomposite project reference for minified files. - Added comprehensive test cases for
Int8Arrayandnumber[]inscripts/test.mjs. - Added to CDNJS (cdnjs/packages#2199).
📊 Benchmark
> pnpm benchmark
$ node scripts/benchmark.mjs && node scripts/test-513MiB.mjs
Data length: 104857600 chars (100MiB)
--------------------------------------------------
tinyhmacmd5 : 374.04 ms
spark-md5 : 513.18 ms
js-md5 : 481.65 ms
crypto-js : 1667.43 ms
blueimp-md5 : 3753.25 ms
node:crypto : 130.88 ms
--------------------------------------------------
✅ All pure JS implementations match node:crypto result.
--- Pure 513MiB Test (No prior small tests) ---
tinyhmacmd5 HMAC-MD5 timer: 1.794s
node:crypto HMAC-MD5 timer: 550.872ms
tinyhmacmd5 MD5 timer: 1.786s
node:crypto MD5 timer: 548.873ms
CPU: i5-10600KF
DRAM: 64GiB DDR4 3333MT/s
OS: Windows 11 Pro for Workstations 25H2 26200.8737
Node.js: v26.8.1
Full Changelog: v0.5.2...v0.5.3
v0.5.2-es2026
v0.5.2
943 Bytes (-12)
- ⚡ Optimize & Eliminate JIT Deopt: Simplified
inputToWordsand 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-md5to benchmarks. - Fixed
js-md5silently delegating tonode:cryptoin Node.js, ensuring a fair pure-JS benchmark. tinyhmacmd5remains the fastest pure-JS MD5 / HMAC-MD5 implementation.
- Added
- 📝 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
v0.5.1-es2026
v0.5.1
955 Bytes (-24)
🚀 Optimize performance: reduced the processing time of 513 MiB data from 2.693s to 1.868s
> pnpm benchmark
$ node scripts/benchmark.mjs && node scripts/test-513MiB.mjs
Data length: 104857600 chars (100MiB)
--------------------------------------------------
tinyhmacmd5 : 388.35 ms
js-md5 : 128.71 ms
blueimp-md5 : 3823.48 ms
crypto-js : 1553.58 ms
node:crypto : 129.86 ms
--------------------------------------------------
✅ All pure JS implementations match node:crypto result.
--- Pure 513MiB Test (No prior small tests) ---
tinyhmacmd5 HMAC-MD5 timer: 1.886s
node:crypto HMAC-MD5 timer: 548.216ms
tinyhmacmd5 MD5 timer: 1.868s
node:crypto MD5 timer: 548.352ms
❤️ Thanks: @jexjws @GuaiZai233
Full Changelog: v0.5.0...v0.5.1
INVINCIBLE EXPERIMENT!
v0.5.0-es2026
947 bytes
v0.5.0
v0.4.2-es2026
975 bytes
Optimize performance.
Full Changelog: v0.4.1-es2026...v0.4.2-es2026