nodejs-keccak256

nodejs-keccak256 is a skill for Claude Code, Codex from gongyijie85/dsh-ecc. It costs 79 tokens per session (835 once invoked), scanned A, a copy of nodejs-keccak256, MIT.

A guide to using Ethereum's Keccak-256 hash in Node.js and TypeScript. It explains that Node's SHA3-256 function is a different algorithm and can silently produce the wrong result for Ethereum.

In plain words
What is it for?
Use it when hashing Ethereum data, reviewing JavaScript or TypeScript crypto code, or implementing EIP-712, Merkle, storage-slot, selector, or address helpers.
Why use it?
It prevents subtle blockchain bugs in values such as function selectors, signatures, event topics, storage slots, and derived addresses.

Skill for Claude CodeCodex

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

Good fit Use it when hashing Ethereum data, reviewing JavaScript or TypeScript crypto code, or implementing EIP-712, Merkle, storage-slot, selector, or address helpers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/gongyijie85/dsh-ecc/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 gongyijie85/dsh-ecc --skill nodejs-keccak256
Clone the repo
git clone --depth 1 https://github.com/gongyijie85/dsh-ecc

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/gongyijie85/dsh-ecc/nodejs-keccak256/github.svg)](https://agentmods.dev/skills/gongyijie85/dsh-ecc/nodejs-keccak256)
Your own site
<a href="https://agentmods.dev/skills/gongyijie85/dsh-ecc/nodejs-keccak256"><img src="https://agentmods.dev/badge/skills/gongyijie85/dsh-ecc/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/gongyijie85/dsh-ecc/nodejs-keccak256"><img src="https://agentmods.dev/badge/skills/gongyijie85/dsh-ecc/nodejs-keccak256.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 835 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 88% 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.00079 $0.00835
Opus 5 $0.00039 $0.00417
Sonnet 5 $0.00016 $0.00167
Haiku 4.5 $0.00008 $0.00084

Measured 5d ago against content hash 973c1194e28b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 5d 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

88% identical to nodejs-keccak256 — 7 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.

skills/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. 5d ago First seen · 104 lines · 79 tokens per session scan A 973c1194e28b

Subscribe to this mod's changes

nodejs-keccak256 is a skill published in the GitHub repository gongyijie85/dsh-ecc (6 stars, last pushed yesterday), licensed MIT. It adds 79 tokens to every session and 835 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 88% identical to nodejs-keccak256, differing in 7 lines, and is treated as a copy.

Related

Other skills, from other repositories

manage-taskboard

Manage work in the native DeepSeek Harness Taskboard with exact task ids and optimistic versions. Use when an Agent must inspect project work, claim an eligible todo, record progress or blockers, verify an implementation, submit it for human review, or release its own claim; also use when a human asks how to accept…

shengsheng90/DSH-taskboard · 88 tokens

qiskit

A collection of quantum algorithms implemented using Qiskit, covering a wide range of topics including quantum search, quantum phase estimation, amplitude amplification, and more. Provides efficient implementations and examples for various quantum computing applications.

unitarylab/quantum-practices · 46 tokens

unitarylab

Use UnitaryLab for local quantum circuit construction, simulation, measurement, expectation values, transpilation, drawing, serialization, and algorithms provided by unitarylab.library. Trigger for runnable UnitaryLab workflows; consult bundled references for package APIs and dedicated algorithm skills for…

unitarylab/quantum-practices · 60 tokens

dsh-web-skin-developer

Build a new skin for the dsh-web skin collection (DSH Web GUI) and publish it into the Skin Center — the first-level settings section — scaffold with scripts/dsh-skin-new, author the v2 skin.json manifest plus skin.css token remap (pure asset directory, no package.json, no build step), validate with scripts/dsh-skin…

zhu1090093659/dsh-web · 120 tokens

dsh-sdk-upgrade

Safely select and install a compatible official @deepseek-ai SDK release for dsh plugin projects (dsh-web, dsh-trading, and similar monorepos) from npm using an isolated worktree, explicit cohort review, CI-equivalent validation, and controlled rollout — including syncing the project's declared DSH host-version floor…

zhu1090093659/dsh-web · 176 tokens

typescript-strict

TypeScript strict mode patterns with interfaces, type guards, generics, and utility types. Use when defining types, creating type-safe functions, handling nullable values, or implementing generic components.

BlackBeltTechnology/pi-agent-dashboard · 41 tokens