How to use the bip39.wordlists.ENGLISH function in bip39

To help you get started, we’ve selected a few bip39 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Emurgo / yoroi-frontend / app / api / ada / lib / cardanoCrypto / paperWallet.js View on Github external
export const scramblePaperAdaMnemonic = (
  phrase: string,
  password: string,
): string => {
  const salt = new Uint8Array(Buffer.from(cryptoRandomString({ length: 2 * 8 }), 'hex'));
  const entropy = RustModule.WalletV2.Entropy.from_english_mnemonics(phrase);
  const bytes = RustModule.WalletV2.paper_wallet_scramble(entropy, salt, password);
  return entropyToMnemonic(Buffer.from(bytes), wordlists.ENGLISH);
};