View Source Slip39.Share (slip39 v0.1.1)

Represents a single mnemonic share

Summary

Functions

Link to this function

binary_to_mnemonic(data)

View Source
@spec decode!(String.t()) :: %Slip39.Share{
  data: term(),
  group_count: term(),
  group_index: term(),
  group_threshold: term(),
  identifier: term(),
  iteration_exponent: term(),
  member_index: term(),
  member_threshold: term()
}

This function will decode a mnemonic string into a Slip39.Share struct.

Example

iex(1)> Slip39.Share.decode!("kernel leader acrobat romp camera unusual fawn engage revenue total blimp quiet muscle clinic slush mouse watch estimate custody glimpse")
%Slip39.Share{
  identifier: 15856,
  iteration_exponent: 0,
  group_index: 0,
  group_threshold: 2,
  group_count: 4,
  member_index: 0,
  member_threshold: 1,
  data: <<116, 239, 149, 20, 122, 245, 231, 69, 107, 62, 90, 37, 51, 169, 87,
    227>>
}
@spec encode!(%Slip39.Share{
  data: term(),
  group_count: term(),
  group_index: term(),
  group_threshold: term(),
  identifier: term(),
  iteration_exponent: term(),
  member_index: term(),
  member_threshold: term()
}) :: [String.t()]

This function will encode a Slip39.Share struct into a mnemonic string.

Link to this function

get_common_parameters(share)

View Source
Link to this function

get_group_parameters(share)

View Source
@spec get_raw_shares([Slip39.Share]) :: [Slip39.Share.RawShare]
Link to this function

mnemonic_to_binary(mnemonic)

View Source
Link to this function

mnemonic_to_indices(mnemonic)

View Source