@aritz-cracker/cryptowasm
TypeScript icon, indicating that this package has built-in type declarations

1.18.0 • Public • Published

Cryptowasm

An ultra-lightweight JavaScript library exposing several cryptographic primitives commonly used in cryptocurrency

Cryptowasm has no dependencies and works in all JavaScript environments, including Node.js, Deno (probably), and browsers.

Purpose

Cryptowasm is a stripped-down fork of libauth by the very skillful bitjson, only including Secp256k1, sha1, sha256, sha512, and Ripemd160. No other utility tools or bitcoin(cash)-specific feature sets.

Getting Started

To get started, install cryptowasm:

npm install cryptowasm

And import the functionality you need:

import { instantiateSecp256k1 } from 'cryptowasm';
import { msgHash, pubkey, sig } from './somewhere';

(async () => {
  const secp256k1 = await instantiateSecp256k1();
  secp256k1.verifySignatureDERLowS(sig, pubkey, msgHash)
    ? console.log('🚀 Signature valid')
    : console.log('❌ Signature invalid');
})();

Stable API

The following APIs are considered stable, and will only include breaking changes in major version upgrades.

WebAssembly ECDSA & Schnorr

WebAssembly Hashing Functions

Package Sidebar

Install

npm i @aritz-cracker/cryptowasm

Homepage

libauth.org/

Weekly Downloads

1

Version

1.18.0

License

MIT

Unpacked Size

2.32 MB

Total Files

231

Last publish

Collaborators

  • aritz-cracker