1.1.7 • Published 5 years ago

bip39-checker v1.1.7

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

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)
1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago