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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@synchronic/bip39

v1.0.2

Published

Synchronic copy @scure/bip39. Secure, audited & minimal implementation of BIP39

Downloads

1

Readme

scure-bip39

Current version: https://github.com/paulmillr/scure-bip39/releases/tag/1.2.1

Synchronic fork @scure/bip39.

Difference from the original library:

  1. ESM JavaScript Code Format
  2. The function response format has been changed from Uint8Array to Buffer
  3. Added wordlist function
  4. The fork is designed to use all 10 dictionaries in supported languages

Usage

npm install @synchronic/bip39

import * as bip39 from '@synchronic/bip39';

// Get a dictionary of 2048 words in the language you need
// english, chinese_simplified, chinese_traditional, czech, french, italian, japanese, korean, portuguese, spanish
const wordlist = bip39.wordlist('english')
console.log(wordlist); // ['abandon', 'ability', 'able', 'about', 'above' ... 2043 more items]

// Generate mnemonic (128 = 12 words, 256 = 24 words). Uses Cryptographically-Secure Random Generator.
const mnemonic = bip39.generateMnemonic(128, wordlist);
console.log(mnemonic); // rice blast wife alert include spring sign flash brisk awake clap holiday

// Reversible: Converts mnemonic string to entropy in Buffer format.
const entropy = bip39.mnemonicToEntropy(mnemonic, wordlist)
console.log(entropy.toString('hex')); // b922efeb831727a67212c31c4204a736

// Reversible: Converts Uint8Array, Buffer, Hex entropy to mnemonic string.
const mnemonic1 = bip39.entropyToMnemonic(entropy, wordlist);
console.log(mnemonic1); // rice blast wife alert include spring sign flash brisk awake clap holiday

// Validates mnemonic for being 12-24 words contained in `wordlist`.
const valid = bip39.validateMnemonic(mnemonic, wordlist);
console.log(valid); // true

// Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password.
const seed = bip39.mnemonicToSeedSync(mnemonic)
console.log(seed.toString('hex')); // dca898a1b2dcbae0a78b889319e76c43f4fa5f491726faf9120d42068f0d46e9a30844dbb1fbd7c3b841ed46a899f403d024b6bfcc02a79d4458c771be757c75

const seedAsync = await bip39.mnemonicToSeed(mnemonic, 'password');
console.log(seedAsync); // <Buffer 24 43 42 21 54 3a 61 3b 59 87 a2 0d 31 86 1f 8b 03 b2 23 51 3b 11 0f 6c f6 a7 c8 1a db ab 04 56 71 f7 f1 2d ba 92 cb 99 22 9a cf 5b 20 5f 59 2a 1a 57 ... 14 more bytes>

MIT License

Copyright (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com)