Skip to content

✅ test: Document Keccak256.hash() always returns fresh copy#272

Merged
roninjin10 merged 1 commit intomainfrom
fix/issue-101-keccak-copy
Jan 4, 2026
Merged

✅ test: Document Keccak256.hash() always returns fresh copy#272
roninjin10 merged 1 commit intomainfrom
fix/issue-101-keccak-copy

Conversation

@roninjin10
Copy link
Contributor

Summary

Test plan

  • Returns new reference each call
  • Mutations don't affect future calls
  • No shared internal state
  • Input mutations don't affect result

🤖 Generated with Claude Code

Closes #101

Investigated the reported bug - Keccak256.hash() uses @noble/hashes
keccak_256 which always returns new Uint8Array via digestInto().
Added 5 tests documenting the copy behavior:
- Returns new copy on each call (not same reference)
- Mutations to returned hash don't affect future calls
- No shared internal state between calls
- Input mutations after hashing don't affect result
- Independent copies in concurrent-like scenarios

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
dist Error Error Jan 4, 2026 10:39am
voltaire Error Error Jan 4, 2026 10:39am

@roninjin10 roninjin10 merged commit 35833aa into main Jan 4, 2026
19 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Keccak256.hash() returns reference not copy in some paths

1 participant