View Source Slip39.Rs1024 (slip39 v0.1.1)

Summary

Functions

Create a checksum (see spec). Data passed as argument should be a bitstring of multiple of radix_size, that is 10

Verify that the given data, included at the end of the data, is valid (see spec).

Functions

@spec create_checksum(bitstring()) :: bitstring()

Create a checksum (see spec). Data passed as argument should be a bitstring of multiple of radix_size, that is 10

iex(1)> Slip39.Rs1024.create_checksum("Long life to Elixir!")
<<183, 154, 93, 32::size(6)>>
Link to this function

is_checksum_valid?(data_and_checksum)

View Source
@spec is_checksum_valid?(bitstring()) :: boolean()

Verify that the given data, included at the end of the data, is valid (see spec).

iex(1)> checksum = Slip39.Rs1024.create_checksum("Long life to Elixir!")
<<183, 154, 93, 32::size(6)>>
iex(2)> Slip39.Rs1024.is_checksum_valid?(<<"Long life to Elixir!"::bitstring, checksum::bitstring>>)
true
iex(3)>  Slip39.Rs1024.is_checksum_valid?(<<"Long life to Elixir?"::bitstring, checksum::bitstring>>)
false