### 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
@@ -93,7 +93,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#line335">line 335</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line341">line 341</a>
</li></ul></dd>
@@ -208,7 +208,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#line734">line 734</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line740">line 740</a>
</li></ul></dd>
@@ -330,7 +330,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#line746">line 746</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line752">line 752</a>
</li></ul></dd>
@@ -452,7 +452,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#line784">line 784</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line790">line 790</a>
</li></ul></dd>
@@ -576,7 +576,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#line768">line 768</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line774">line 774</a>
</li></ul></dd>
@@ -698,7 +698,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#line712">line 712</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line718">line 718</a>
</li></ul></dd>
@@ -820,7 +820,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#line667">line 667</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line673">line 673</a>
</li></ul></dd>
@@ -942,7 +942,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#line700">line 700</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line706">line 706</a>
</li></ul></dd>
@@ -1122,7 +1122,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#line363">line 363</a>
<a href="md5.js.html">md5.js</a>, <a href="md5.js.html#line369">line 369</a>
</li></ul></dd>