ilap / slip39-js

The javascript implementation of the SLIP39 for Shamir's Secret-Sharing for Mnemonic Codes.
MIT License
69 stars 27 forks source link

ability to validate mnemonics #2

Closed joernroeder closed 5 years ago

joernroeder commented 5 years ago

Hi, At the moment there is no way to validate individual mnemonics before trying to recover the seed and decodeMnemonic is not available outside the module.

Therefore i am suggesting a public slip39.validateMnemonic(mnemonic: String, wordlist=DEFAULT_WORDLIST) => boolean function similar to the one available in bip39 https://github.com/bitcoinjs/bip39/blob/master/src/index.js#L133. A common (and also my current use case for it) is the ability to validate user input before allowing them to enter the next share.

I could push a pull request to this repo if you like but due to the fact that your dart implementation is the primary one i think this new feature should land there too.

ilap commented 5 years ago

Hi,

You can create a PR and I will implement it in the dart code.

Cheers,

Pal

joernroeder commented 5 years ago

closed via 797b1f80350a1962adfff9c3acf1b10e5ca36576