npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eth-crypto-ts

v0.0.6

Published

eth-crypto library with typescript

Readme

eth-crypto-ts

npm version

A lightweight, TypeScript-first cryptography library for Ethereum. Built as an improvement over the original eth-crypto, with a curated subset of functions and zero Node.js polyfill requirements.

Why eth-crypto-ts?

  • Lightweight — Uses @noble/hashes instead of heavy alternatives, significantly reducing bundle size
  • No polyfills — Works seamlessly in browsers, React Native, and Node.js without requiring crypto or other Node.js native module polyfills
  • TypeScript-first — Fully typed, built with modern TypeScript
  • Focused API — Exports only the essential crypto functions needed for Ethereum applications

Installation

npm install eth-crypto-ts

API

createIdentity()

Creates a new Ethereum identity (private key + public key).

import { createIdentity } from 'eth-crypto-ts';

const identity = createIdentity();
// { privateKey: '0x...', publicKey: '0x...' }

sign(privateKey, message)

Sign a message with a private key.

import { sign } from 'eth-crypto-ts';

const signature = sign(privateKey, messageHash);

encryptWithPublicKey(publicKey, message)

Encrypt data with a public key using ECIES.

import { encryptWithPublicKey } from 'eth-crypto-ts';

const encrypted = encryptWithPublicKey(publicKey, 'secret message');
// { iv, ephemPublicKey, ciphertext, mac }

decryptWithPrivateKey(privateKey, encrypted)

Decrypt ECIES-encrypted data with a private key.

import { decryptWithPrivateKey } from 'eth-crypto-ts';

const message = decryptWithPrivateKey(privateKey, encrypted);

publicKeyByPrivateKey(privateKey)

Derive the public key from a private key.

import { publicKeyByPrivateKey } from 'eth-crypto-ts';

const publicKey = publicKeyByPrivateKey(privateKey);

recoverPublicKey(messageHash, signature)

Recover the public key from a message and its signature.

import { recoverPublicKey } from 'eth-crypto-ts';

const publicKey = recoverPublicKey(messageHash, signature);

keccak256(data)

Compute the Keccak-256 hash.

import { keccak256 } from 'eth-crypto-ts';

const hash = keccak256('0x' + Buffer.from('data').toString('hex'));

Or use the namespaced version:

import { hash } from 'eth-crypto-ts';

const h = hash.keccak256('0x...');

Notes

  • This library is a curated subset of the original eth-crypto, focusing on the most commonly needed functions
  • Ideal for applications where bundle size and environment compatibility matter

License

ISC