Bitcoinex.Base58 (bitcoinex v0.1.6) View Source

Includes Base58 serialization and validation.

Some code is inspired by: https://github.com/comboy/bitcoin-elixir/blob/develop/lib/bitcoin/base58_check.ex

Link to this section Summary

Types

Base58 encoding is only supported for p2sh and p2pkh address types.

Functions

Decodes a Base58 encoded string into a byte array and validates checksum.

Decodes a Base58 encoded string into a byte array.

Encodes binary into a Base58 encoded string.

Encodes a binary into a Base58 encoded string.

Validates a Base58 checksum.

Link to this section Types

Specs

address_type() :: :p2sh | :p2pkh

Base58 encoding is only supported for p2sh and p2pkh address types.

Specs

byte_list() :: [byte()]

Link to this section Functions

Specs

append_checksum(binary()) :: binary()

Specs

decode(binary()) :: {:ok, binary()} | {:error, atom()}

Decodes a Base58 encoded string into a byte array and validates checksum.

Specs

decode_base!(binary()) :: binary()

Decodes a Base58 encoded string into a byte array.

Specs

encode(binary()) :: String.t()

Encodes binary into a Base58 encoded string.

Specs

encode_base(binary()) :: String.t()

Encodes a binary into a Base58 encoded string.

Specs

validate_checksum(binary()) :: {:ok, binary()} | {:error, atom()}

Validates a Base58 checksum.