Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/polkadot/mod.ts>utilCrypto.mnemonicToLegacySeed

Package publishing for deno.land/x/polkadot
Go to Latest
function utilCrypto.mnemonicToLegacySeed
import { utilCrypto } from "https://deno.land/x/polkadot@0.2.27/mod.ts";
const { mnemonicToLegacySeed } = utilCrypto;

Examples

import { mnemonicGenerate, mnemonicToLegacySeed, mnemonicValidate } from 'https://deno.land/x/polkadot@0.2.27/util-crypto/mod.ts';

const mnemonic = mnemonicGenerate(); // => string
const isValidMnemonic = mnemonicValidate(mnemonic); // => boolean

if (isValidMnemonic) {
  console.log(`Seed generated from mnemonic: ${mnemonicToLegacySeed(mnemonic)}`); => u8a
}

Parameters

mnemonic: string
optional
password = [UNSUPPORTED]
optional
onlyJs: boolean
optional
byteLength: 32 | 64 = [UNSUPPORTED]

Returns

Uint8Array