BitcoinElixir.Base58 (bitcoin_elixir v0.1.0)

Copy Markdown View Source

Base58 and Base58Check, as used by extended keys and legacy addresses.

Summary

Functions

Decode text.

Decode and verify the checksum.

Encode bytes.

Encode with a 4-byte double-SHA-256 checksum.

Functions

decode(text)

@spec decode(String.t()) :: {:ok, binary()} | {:error, :not_base58}

Decode text.

decode_check(text)

@spec decode_check(String.t()) :: {:ok, binary()} | {:error, atom()}

Decode and verify the checksum.

encode(bytes)

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

Encode bytes.

encode_check(payload)

@spec encode_check(binary()) :: String.t()

Encode with a 4-byte double-SHA-256 checksum.