Options
All
  • Public
  • Public/Protected
  • All
Menu

Module mnemonics/mnemonic-phrase

Index

Type aliases

Bit

Bit: 0 | 1

Functions

Const bitsToBuffer

  • bitsToBuffer(bits: Bit[]): Uint8Array

Const bufferToBits

  • bufferToBits(buffer: Uint8Array): Bit[]

Const chunk

  • chunk<T>(array: T[], size: number): T[][]

Const entropyToMnemonic

  • entropyToMnemonic(entropy: Uint8Array): string
  • Get a mnemonic phrase from pre-generated entropy. Note that the entropy should be sufficiently random in order for the mnemonic phrase to be secure.

    Parameters

    • entropy: Uint8Array

    Returns string

Const generateMnemonic

  • generateMnemonic(size: number): string

Const getChecksum

  • getChecksum(entropy: Uint8Array): Bit[]

Const getMnemonicWord

  • getMnemonicWord(bits: Bit[]): string

Const isValidMnemonic

  • isValidMnemonic(mnemonic: string): boolean

Const mnemonicToEntropy

  • mnemonicToEntropy(mnemonic: string): Uint8Array
  • Get the initial entropy from a mnemonic phrase. Throws an error if the mnemonic phrase is invalid.

    Parameters

    • mnemonic: string

    Returns Uint8Array

Const mnemonicToSeed

  • mnemonicToSeed(mnemonic: string, passphrase?: string): Uint8Array
  • Derive a seed from a mnemonic phrase. This does not validate if a mnemonic phrase is valid.

    Parameters

    • mnemonic: string
    • Optional passphrase: string

    Returns Uint8Array

Generated using TypeDoc