
Nodejs Keccak256
If you're building Ethereum tooling in JavaScript or TypeScript, you've probably already shipped this bug. Node's `crypto.createHash('sha3-256')` implements NIST SHA3, not the Keccak-256 variant Ethereum actually uses, and the outputs are silently different. This skill teaches Claude to catch the distinction and use the right helpers from ethers, viem, or web3.js when computing function selectors, event topics, storage slots, or deriving addresses from public keys. It includes grep commands to audit your codebase and side-by-side examples showing why `nistSha3 === keccak` returns false. Small footgun, massive consequences if you get it wrong.
- skills.sh installs
- 3.5K
- GitHub stars
- 229.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add affaan-m/everything-claude-code --skill nodejs-keccak256 --agent claude-codeInstalls into .claude/skills of the current project.
Files
Node.js Keccak-256
Ethereum uses Keccak-256, not the NIST-standardized SHA3 variant exposed by Node's crypto.createHash('sha3-256').
When to Use
- Computing Ethereum function selectors or event topics
- Building EIP-712, signature, Merkle, or storage-slot helpers in JS/TS
- Reviewing any code that hashes Ethereum data with Node crypto directly
How It Works
The two algorithms produce different outputs for the same input, and Node will not warn you.
import crypto from 'crypto';
import { keccak256, toUtf8Bytes } from 'ethers';
const data = 'hello';
const nistSha3 = crypto.createHash('sha3-256').update(data).digest('hex');
const keccak = keccak256(toUtf8Bytes(data)).slice(2);
console.log(nistSha3 === keccak); // false
Examples
ethers v6
import { keccak256, toUtf8Bytes, solidityPackedKeccak256, id } from 'ethers';
const hash = keccak256(new Uint8Array([0x01, 0x02]));
const hash2 = keccak256(toUtf8Bytes('hello'));
const topic = id('Transfer(address,address,uint256)');
const packed = solidityPackedKeccak256(
['address', 'uint256'],
['0x742d35Cc6634C0532925a3b8D4C9B569890FaC1c', 100n],
);
viem
Sponsors
Details
- Repository
- github.com/affaan-m/everything-claude-code
- First seen
- May 16, 2026
More from affaan-m/everything-claude-code
All 256- Product Capability3.5K
- Research Ops3.5K
- Unified Notifications Ops3.5K
- Evm Token Decimals3.4K
- Gateguard3.1K
- Everything Claude Code2.7K
- Claude Api2.4K
- Hermes Imports2.3K
- Literature Review1.9K
- Fastapi Patterns1.8K
- Frontend Design1.8K
- Mysql Patterns1.8K
- Pubmed Database1.8K
- Windows Desktop E2e1.8K
- Agent Architecture Audit1.7K
- Agentic Os1.7K
- Angular Developer1.7K
- Cisco Ios Patterns1.7K
- Django Celery1.7K
- Ecc Guide1.7K
- Error Handling1.7K
- Flox Environments1.7K
- Frontend Design Direction1.7K
- Homelab Network Readiness1.7K