nodejs-keccak256

nodejs-keccak256 is a skill for Claude Code, Codex from nklofy/code-agent-skills. It costs 51 tokens per session (806 once invoked), scanned A, a copy of nodejs-keccak256, Apache-2.0.

A Node.js and TypeScript guide for using Ethereum's Keccak-256 hash, which is different from the standard SHA3-256 hash included in Node. It covers hashing used by smart-contract selectors, signatures, event topics, storage slots, and address derivation.

In plain words
What is it for?
Use it when writing or reviewing JavaScript or TypeScript code for Ethereum hashing, EIP-712 signatures, Merkle trees, event topics, function selectors, or storage slots.
Why use it?
Node can calculate the wrong hash without warning, causing Ethereum code to produce incorrect values.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when writing or reviewing JavaScript or TypeScript code for Ethereum hashing, EIP-712 signatures, Merkle trees, event topics, function selectors, or storage slots.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nklofy/code-agent-skills/nodejs-keccak256
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nklofy/code-agent-skills --skill nodejs-keccak256
Clone the repo
git clone --depth 1 https://github.com/nklofy/code-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nodejs-keccak256

README.md
[![agentmods](https://agentmods.dev/badge/skills/nklofy/code-agent-skills/nodejs-keccak256/github.svg)](https://agentmods.dev/skills/nklofy/code-agent-skills/nodejs-keccak256)
Your own site
<a href="https://agentmods.dev/skills/nklofy/code-agent-skills/nodejs-keccak256"><img src="https://agentmods.dev/badge/skills/nklofy/code-agent-skills/nodejs-keccak256/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nodejs-keccak256

Your own site · 80×15
<a href="https://agentmods.dev/skills/nklofy/code-agent-skills/nodejs-keccak256"><img src="https://agentmods.dev/badge/skills/nklofy/code-agent-skills/nodejs-keccak256.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 806 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 92% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.00806
Opus 5.5 $0.00020 $0.00322
Sonnet 5.5 $0.00010 $0.00161
Haiku 4.5 $0.00005 $0.00081

Measured 2mo ago against content hash fa647bd76412, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nodejs-keccak256 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

92% identical to nodejs-keccak256 — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

affaan-m-ECC/nodejs-keccak256/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

import { keccak256, toBytes } from 'viem';

const hash = keccak256(toBytes('hello'));

web3.js

const hash = web3.utils.keccak256('hello');
const packed = web3.utils.soliditySha3(
  { type: 'address', value: '0x742d35Cc6634C0532925a3b8D4C9B569890FaC1c' },
  { type: 'uint256', value: '100' },
);

Common patterns

import { id, keccak256, AbiCoder } from 'ethers';

const selector = id('transfer(address,uint256)').slice(0, 10);
const typeHash = keccak256(toUtf8Bytes('Transfer(address from,address to,uint256 value)'));

function getMappingSlot(key: string, mappingSlot: number): string {
  return keccak256(
    AbiCoder.defaultAbiCoder().encode(['address', 'uint256'], [key, mappingSlot]),
  );
}

Address from public key

import { keccak256 } from 'ethers';

function pubkeyToAddress(pubkeyBytes: Uint8Array): string {
  const hash = keccak256(pubkeyBytes.slice(1));
  return '0x' + hash.slice(-40);
}

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 104 lines · 51 tokens per session scan A fa647bd76412

Subscribe to this mod's changes

nodejs-keccak256 is a skill published in the GitHub repository nklofy/code-agent-skills (18 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 51 tokens to every session and 806 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 92% identical to nodejs-keccak256, differing in 3 lines, and is treated as a copy.

Related

nodejs-keccak256 compared with skills from other repositories

nodejs-keccak256 next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
nodejs-keccak256nklofy/code-agent-skillsSkill184mo agoApache-2.0A51Claude Code, Codex
starknet-jsstarknet-io/starknet.jsSkill1.3kyesterdayMITA79Claude Code, Codex
adding-personhog-rpcPostHog/posthogSkill41kyesterdaynoneA88Claude Code, Codex
bnb-chain-toolkit-guidenirholas/three.wsSkill269yesterdayApache-2.0A67Claude Code, Codex
solana-toolkit-guidenirholas/three.wsSkill269yesterdayApache-2.0A50Claude Code, Codex
viem-integrationUniswap/uniswap-aiSkill2362d agoMITA69Claude Code
wallet-cliBofAI/skillsSkill1644d agoMITA92Codex