Skip to content

Mnemonic.random

Generates a random mnemonic.

Imports

Named
import { Mnemonic } from 'ox'

Examples

import { Mnemonic } from 'ox'
 
const mnemonic = Mnemonic.random(Mnemonic.english)
'buyer zoo end danger ice capable shrug naive twist relief mass bonus'

Definition

function random(
  wordlist: string[],
  options?: random.Options,
): string

Source: src/core/Mnemonic.ts

Parameters

wordlist

  • Type: string[]

The wordlist to use.

options

  • Type: random.Options
  • Optional

Generation options.

options.strength

  • Type: number
  • Optional

The strength of the mnemonic to generate, in bits.

Return Type

The mnemonic.

string