npm.io
3.0.0 • Published 2 months ago

@hazae41/ed25519

Licence
Version
3.0.0
Deps
1
Size
7 kB
Vulns
0
Weekly
0

Ed25519

Ed25519 for the web

npm install @hazae41/ed25519

NPM

Features

Current features

  • 100% TypeScript and ESM
  • No external dependencies
Why not use WebCrypto
  • Safari produces non-deterministic signatures
  • Tor browser (Firefox ESR) can't recover public key from private key

Usage

const key = ed25519.SecretKey.random()
const pub = key.publish()

const msg = Uint8Array.fromHex("deadbeef")
const sig = key.sign(msg)

console.log(pub.verify(msg, sig)) // true

Keywords