Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
};