### Fixed

- Incorrect hash for `DataView` input.
- Throws `ArrayBuffer is not defined` in browsers without `ArrayBuffer`.

### Changed
- Multi-byte typed arrays such as `Uint16Array`, `Uint32Array` and `Float32Array` are now hashed by their underlying bytes, the same as Node.js `crypto` and Web Crypto. Previously each element was treated as one byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Yi-Cyuan Chen
2026-11-18 13:31:55 +08:00
co-authored by Claude Opus 5.5
parent c2a7870840
commit 66db5dbd99
31 changed files with 186 additions and 103 deletions
+9 -9
View File
@@ -71,7 +71,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line225">line 225</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line231">line 231</a>
</li></ul></dd>
@@ -252,7 +252,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line251">line 251</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line257">line 257</a>
</li></ul></dd>
@@ -457,7 +457,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line261">line 261</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line267">line 267</a>
</li></ul></dd>
@@ -662,7 +662,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line282">line 282</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line288">line 288</a>
</li></ul></dd>
@@ -869,7 +869,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line271">line 271</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line277">line 277</a>
</li></ul></dd>
@@ -1042,7 +1042,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line298">line 298</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line304">line 304</a>
</li></ul></dd>
@@ -1247,7 +1247,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line241">line 241</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line247">line 247</a>
</li></ul></dd>
@@ -1452,7 +1452,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line228">line 228</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line234">line 234</a>
</li></ul></dd>
@@ -1659,7 +1659,7 @@ md5.hmac('key', 'The quick brown fox jumps over the lazy dog');</code></pre>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line307">line 307</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line313">line 313</a>
</li></ul></dd>