We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some backup solutions only allow storing the first 4 letters in accordance with the BIP39 protocol.
My understanding is that the first-four-letter combinations are unique and sufficient to recover the full word.
Does this package support that?
It’s something I’m trying to figure out for dfinity/internet-identity#335
The text was updated successfully, but these errors were encountered:
No. This is easily done with 1 line. Maybe a couple extra lines to check inputs.
function findFirstFour(firstFour, wordlist) { if (typeof firstFour !== 'string' || firstFour.length !== 4) throw new Error('Need 4 characters') if (!Array.isArray(wordlist) || wordlist.length !== 2048 || wordlist[1353] !== 'powder') throw new Error('Use bip39 English wordlist') return wordlist.filter(s => s.startsWith(firstFour))[0] }
Sorry, something went wrong.
No branches or pull requests
Some backup solutions only allow storing the first 4 letters in accordance with the BIP39 protocol.
My understanding is that the first-four-letter combinations are unique and sufficient to recover the full word.
Does this package support that?
It’s something I’m trying to figure out for dfinity/internet-identity#335
The text was updated successfully, but these errors were encountered: