View Source BitcoinLib.Key.HD.SeedPhrase.Wordlist (BitcoinLib v0.4.7)

A list of all the words that can be contained in a private key seed phrase

Source: https://raw.githubusercontent.com/bitcoin/bips/master/bip-0039/english.txt

Link to this section Summary

Functions

Get a list of all words in the wordlist

Convert a word into an indice from the wordlist

Convert a list of words into a list of indices from the wordlist

Get a single word from the wordlist by index

Convert a list of indices into words from the wordlist

Link to this section Functions

@spec all() :: [binary()]

Get a list of all words in the wordlist

examples

Examples

iex> BitcoinLib.Key.HD.SeedPhrase.Wordlist.all
...> |> Enum.count()
2048
@spec get_indice(binary()) :: {:found, integer(), binary()} | {:not_found, integer()}

Convert a word into an indice from the wordlist

examples

Examples

iex> BitcoinLib.Key.HD.SeedPhrase.Wordlist.get_indice("absurd")
{:found, 8, "absurd"}
@spec get_indices([binary()]) :: [integer()]

Convert a list of words into a list of indices from the wordlist

examples

Examples

iex> ["absurd", "able", "absent"]
...> |> BitcoinLib.Key.HD.SeedPhrase.Wordlist.get_indices()
[8, 2, 5]
@spec get_word(integer()) :: binary()

Get a single word from the wordlist by index

examples

Examples

iex> BitcoinLib.Key.HD.SeedPhrase.Wordlist.get_word(8)
"absurd"
@spec get_words([integer()]) :: [binary()]

Convert a list of indices into words from the wordlist

examples

Examples

iex> BitcoinLib.Key.HD.SeedPhrase.Wordlist.get_words([8, 2, 5])
["absurd", "able", "absent"]