Base58Check (base_58_check v1.0.0)

Link to this section Summary

Functions

Decodes the given string.

decode a specific bitcoin Base58 representation with checksum to a binary

decode a specific bitcoin Base58 representation into a binary

Encodes the given integer.

encode a binary into the specific bitcoin Base58 representation with checksum

encode a binary into the specific bitcoin Base58 representation

Link to this section Functions

Link to this function

decode58!(string)

Decodes the given string.

Examples

iex> Base58Check.decode58!("1")
<<0>>

iex> Base58Check.decode58!("z")
<<57>>

iex> Base58Check.decode58!("Jf")
:binary.encode_unsigned(1024)

iex> Base58Check.decode58!("BukQL")
:binary.encode_unsigned(123_456_789)
Link to this function

decode58check!(string)

decode a specific bitcoin Base58 representation with checksum to a binary

iex> Base58Check.decode58check!("1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY")
<<200, 37, 161, 236, 242, 166, 131, 12, 68, 1, 98, 12, 58, 22, 241, 153, 80, 87, 194, 171>>
Link to this function

decode58zero!(string)

decode a specific bitcoin Base58 representation into a binary

Examples

iex> Base58Check.decode58zero!("111113yzKE")
<<0,0,0,0,0,2,3,4,5>>
Link to this function

encode58(binary)

Encodes the given integer.

Examples

iex> Base58Check.encode58(<<0>>)
"1"

iex> Base58Check.encode58(<<57>>)
"z"

iex> Base58Check.encode58(:binary.encode_unsigned(1024))
"Jf"

iex> Base58Check.encode58(:binary.encode_unsigned(123_456_789))
"BukQL"
Link to this function

encode58check(binary, type, network)

encode a binary into the specific bitcoin Base58 representation with checksum

Examples

iex> Base58Check.encode58check(<<200, 37, 161, 236, 242, 166, 131, 12, 68, 1, 98, 12, 58, 22, 241, 153, 80, 87, 194, 171>>, :p2pkh, :main)
"1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY"
Link to this function

encode58zero(binary)

encode a binary into the specific bitcoin Base58 representation

Examples

iex> Base58Check.encode58zero(<<0,0,0,0,0,2,3,4,5>>)
"111113yzKE"