Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function mnemonicToSeed(mnemonic, password) {
if (!password) {
password = "";
}
const salt = toUtf8Bytes("mnemonic" + password, UnicodeNormalizationForm.NFKD);
return pbkdf2(toUtf8Bytes(mnemonic, UnicodeNormalizationForm.NFKD), salt, 2048, 64, "sha512");
}
export function mnemonicToEntropy(mnemonic, wordlist) {
export function mnemonicToSeed(mnemonic, password) {
if (!password) {
password = "";
}
const salt = toUtf8Bytes("mnemonic" + password, UnicodeNormalizationForm.NFKD);
return pbkdf2(toUtf8Bytes(mnemonic, UnicodeNormalizationForm.NFKD), salt, 2048, 64, "sha512");
}
export function mnemonicToEntropy(mnemonic, wordlist) {
export function mnemonicToSeed(mnemonic: string, password?: string): string {
if (!password) { password = ""; }
const salt = toUtf8Bytes("mnemonic" + password, UnicodeNormalizationForm.NFKD);
return pbkdf2(toUtf8Bytes(mnemonic, UnicodeNormalizationForm.NFKD), salt, 2048, 64, "sha512");
}
export function mnemonicToSeed(mnemonic: string, password?: string): string {
if (!password) { password = ""; }
const salt = toUtf8Bytes("mnemonic" + password, UnicodeNormalizationForm.NFKD);
return pbkdf2(toUtf8Bytes(mnemonic, UnicodeNormalizationForm.NFKD), salt, 2048, 64, "sha512");
}