Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bip39-checker

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bip39-checker

The BIP-0039 wordlist normalization and spell check module.

  • 1.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-40%
Maintainers
1
Weekly downloads
 
Created
Source

NPM Build Status Coverage Status

BIP-0039 Checker

Normalize and spell check BIP-0039 brain seed phrases.

Interfaces may gather word suggestions from this package and use them for auto-complete or show them as suggestions for misspelled words (this could help a user recover their funds).

API

const assert = require('assert')
const {normalize, checkWords, suggest} = require('bip39-checker')

// 'english' is the default and may be omitted..

// Normalizes
assert.equal('double spaces', normalize('double  spaces'), 'removes extra spaces')
assert.equal('lowercase', normalize('Lowercase'), 'lowercase')
assert.equal('trim', normalize('  trim  '), 'trim')

// Checks each word in the seed
assert(checkWords('lazy dog', 'english'))
assert(!checkWords('lazy ogday', 'english'))

// Auto-correct suggestions
assert(suggest('quality') === true)
assert(suggest('ágil', {language: 'spanish'}) === true)
assert.equal(suggest('quality1')[0], 'quality')

// BIP-0039 dictionaries are exported
const {languages, wordlist} = require('bip39-checker')

console.log(languages)
assert(wordlist(languages[0]))

// Word list array for a given language
assert(wordlist('english').length, 2048)
assert(wordlist('spanish').length, 2048)
// etc.. (all languages must be 2048 words)

FAQs

Package last updated on 28 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc