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

react-native-quick-scure-bip39

v1.0.0

Published

Secure, based on audited scure-bip39 and react-native-quick-crypto implementation of BIP39 mnemonic phrases

Downloads

2

Readme

react-native-quick-scure-bip39

Secure, based on audited scure-bip39 and react-native-quick-crypto implementation of BIP39 mnemonic phrases

Usage

npm install react-native-quick-scure-bip39

Or

yarn add react-native-quick-scure-bip39

import * as bip39 from 'react-native-quick-scure-bip39';
import { wordlist } from 'react-native-quick-scure-bip39/wordlists/english';

// Generate x random words. Uses Cryptographically-Secure Random Number Generator.
const mn = bip39.generateMnemonic(wordlist);
console.log(mn);

// Reversible: Converts mnemonic string to raw entropy in form of byte array.
const ent = bip39.mnemonicToEntropy(mn, wordlist);

// Reversible: Converts raw entropy in form of byte array to mnemonic string.
bip39.entropyToMnemonic(ent, wordlist);

// Validates mnemonic for being 12-24 words contained in `wordlist`.
bip39.validateMnemonic(mn, wordlist);

// Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password.
await bip39.mnemonicToSeed(mn, 'password');
bip39.mnemonicToSeedSync(mn, 'password');

This submodule contains the word lists defined by BIP39 for Czech, English, French, Italian, Japanese, Korean, Simplified and Traditional Chinese, and Spanish. These are not imported by default, as that would increase bundle sizes too much. Instead, you should import and use them explicitly.

function generateMnemonic(wordlist: string[], strength?: number): string;
function mnemonicToEntropy(mnemonic: string, wordlist: string[]): Uint8Array;
function entropyToMnemonic(entropy: Uint8Array, wordlist: string[]): string;
function validateMnemonic(mnemonic: string, wordlist: string[]): boolean;
function mnemonicToSeed(mnemonic: string, passphrase?: string): Promise<Uint8Array>;
function mnemonicToSeedSync(mnemonic: string, passphrase?: string): Uint8Array;

All wordlists:

import { wordlist } from 'react-native-quick-scure-bip39/bip39/wordlists/czech';
import { wordlist } from 'react-native-quick-scure-bip39/bip39/wordlists/english';
import { wordlist } from 'react-native-quick-scure-bip39/bip39/wordlists/french';
import { wordlist } from 'react-native-quick-scure-bip39/bip39/wordlists/italian';
import { wordlist } from 'react-native-quick-scure-bip39/bip39/wordlists/japanese';
import { wordlist } from 'react-native-quick-scure-bip39/bip39/wordlists/korean';
import { wordlist } from 'react-native-quick-scure-bip39/bip39/wordlists/simplified-chinese';
import { wordlist } from 'react-native-quick-scure-bip39/bip39/wordlists/spanish';
import { wordlist } from 'react-native-quick-scure-bip39/bip39/wordlists/traditional-chinese';

License

MIT License

Copyright (c) 2023 Iliya Bolotov (bolotov-iliya.space)