### Fixed

- Wrong digest for strings whose last UTF-8 character crosses a block boundary #62

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Yi-Cyuan Chen
2026-11-08 14:14:00 +08:00
co-authored by Claude Opus 5.5
parent c3fc9645d4
commit 03e1b80195
9 changed files with 48 additions and 12 deletions
+2 -2
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -9,7 +9,7 @@ var sha3$1 = {exports: {}};
/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.13.0
* @version 0.14.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2026
* @license MIT
@@ -425,7 +425,7 @@ var sha3$1 = {exports: {}};
this.finalized = true;
var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;
blocks[i >> 2] |= this.padding[i & 3];
if (this.lastByteIndex === this.byteCount) {
if (this.lastByteIndex >= this.byteCount) {
blocks[0] = blocks[blockCount];
for (i = 1; i < blockCount + 1; ++i) {
blocks[i] = 0;