What problem does it solve?
Node.js's default crypto.createHash('sha3-256') uses the NIST-standardized SHA3 variant, not Ethereum's Keccak-256 algorithm, causing silent, hard-to-debug bugs in Ethereum-related operations like function selector generation, signature verification, storage slot calculation, and address derivation.
Core Features & Use Cases
- Correct Keccak-256 Guidance: Provides clear rules and examples to ensure Ethereum hashing uses the proper algorithm in JavaScript and TypeScript projects.
- Cross-Library Examples: Includes working code snippets for popular Web3 libraries including ethers, viem, and web3.js.
- Codebase Audit Support: Offers grep commands to quickly locate incorrect sha3-256 usage in existing codebases.
- Use Case: A developer building a decentralized application (dApp) that interacts with Ethereum smart contracts can use this skill to avoid failed transactions and incorrect signature validation caused by hashing algorithm mismatches.
Quick Start
Use the nodejs-keccak256 skill to audit your JavaScript or TypeScript codebase for incorrect NIST SHA3-256 usage and replace it with the proper Ethereum Keccak-256 implementation for all blockchain-related hashing operations.