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 🙏

© 2025 – Pkg Stats / Ryan Hefner

signing-tools

v0.1.0

Published

Sign messages and use keys in Node and browser

Readme

simplesigner

Simpler api for EC keys

Node

import { Signingtools } from 'signing-tools'

const crypto = new Signingtools()
crypto.createKeys('844a4f5aaeef10dd522761264ae08ebe7b1a50d5dfaa18f48979c78b0e9a0f33')
console.log(`Created keys: ${JSON.stringify(crypto, null, 2)}`)

// Sign a message
const message = 'this message'
const sig = crypto.sign(message)
console.log(`Signing message. ${message}, sig = ${sig}`)

// Verify a message
const verified = crypto.verify(message, sig)
console.log(`Verifying message: ${verified} ${sig} ${message}`)

// Verify a message with public key
const verified2 = JSON.stringify(crypto.verifyPublic(message, sig))
console.log(`Verify message with public: ${message} ${sig} ${verified2}`)

// Verify a message with public key
const verified3 = JSON.stringify(crypto.verifyPublic('bad msg', sig))
console.log(`Failed verify message with public: ${message} ${sig} ${verified3}`)

// Hash a message
const hashed = crypto.hash('cb')
console.log(`Hash a value: "cb" ${hashed}`)

// Encrypt a string
let encryptedData = crypto.encrypt('text to hide')
console.log(`Encrypt "text to hide": ${JSON.stringify(encryptedData)}`)

// Decrypt a string
let decryptedData = crypto.decrypt(encryptedData)
console.log(`Decrypt some data: ${decryptedData}`)

Browser

  // <script src='//unpkg.com/signing-tools/browser.js'></script>

  // <script type='module'>
  const simplesign = new Simplesign()

  const keys = await simplesign.createKeys()
  console.log(keys)
   
  const sig = await simplesign.sign('hello world')
  console.log('sign a string', sig)

  const verified = await simplesign.verify('hello world', sig)
  console.log('verified true should be true', verified, sig)

  const notverified = await simplesign.verify('!world', sig)
  console.log('verified should be false', notverified)

  const notverified2 = await simplesign.verify('hello world', 'BADSIG')
  console.log('verified should be false', notverified2)

  const hash = await simplesign.hash('cb')
  console.log('hash', hash=='103d6254a6d94bacc82e822885185f56c69cb799ec5124c0aa405e386975151b', hash)

  const exportPub = await simplesign.exportPublic()
  console.log('export public', exportPub)

  const exportPriv = await simplesign.exportPrivate()
  console.log('export private', exportPriv)

  const jwk = `{
  "crv": "P-384",
  "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_",
  "ext": true,
  "key_ops": ["sign"],
  "kty": "EC",
  "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ",
  "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW"
  }`

  const k = await simplesign.importPrivate(jwk)
  console.log('import private', k)

  const exp = await simplesign.exportPrivate()
  console.log(jwk)
  console.log('export private', JSON.stringify(exp, null, 2))