Multiformats.Multibase (multiformats_ex v0.2.0)

Multibase is a protocol for disambiguating the "base encoding" used to express binary data in text formats, as specified by multiformats.

Note: Not all "official" multibase encodings are implemented here. Only those marked as "final" are guaranteed to be present.

Summary

Functions

Attempts to decode a binary string.

Decodes a multibase-encoded string. This will not return information about the encoding used, just the decoded binary data.

Encodes binary data using a supported multibase encoding.

Functions

decode(data, opts \\ [])

@spec decode(binary(), any()) :: {:ok, binary()} | {:error, Error.t()}

Attempts to decode a binary string.

decode!(data, opts \\ [])

@spec decode!(binary(), any()) :: binary()

Decodes a multibase-encoded string. This will not return information about the encoding used, just the decoded binary data.

encode(data, atom)

@spec encode(binary(), atom()) :: binary()

Encodes binary data using a supported multibase encoding.