View Source ExIpfs.Multibase (Elixir IPFS v0.1.8)

ExIpfs.Multibase is where the multibase commands of the IPFS API reside.

Summary

Types

A multibase codec.

A multibase encoding.

Functions

Decode a multibase encoded string.

Encode a string to a multibase encoded string.

List available multibase encodings.

Transcode a multibase encoded string.

Types

@type codec() :: %ExIpfs.MultibaseCodec{
  code: non_neg_integer(),
  description: binary(),
  name: binary(),
  prefix: binary()
}

A multibase codec.

@type encoding() :: %ExIpfs.MultibaseEncoding{code: non_neg_integer(), name: binary()}

A multibase encoding.

Functions

@spec decode(binary()) :: {:ok, binary()} | ExIpfs.Api.error_response()
@spec decode(list()) :: {:ok, list()} | ExIpfs.Api.error_response()
@spec decode!(binary()) :: any() | ExIpfs.Api.error_response()

Decode a multibase encoded string.

Parameters

data - Data to decode.

Link to this function

encode(data, opts \\ [])

View Source
@spec encode(binary(), list()) :: {:ok, binary()} | ExIpfs.Api.error_response()
Link to this function

encode!(data, opts \\ [])

View Source
@spec encode!(binary(), list()) :: binary() | ExIpfs.Api.error_response()

Encode a string to a multibase encoded string.

Parameters

data - File to encode.

Options

b - Multibase encoding to use.

@spec list(list()) :: {:ok, [codec()]} | ExIpfs.Api.error_response()

List available multibase encodings.

Options

prefix - Only list encodings with the given prefix. numeric - Only list encodings with the given numeric code.

Link to this function

transcode(data, opts \\ [])

View Source
@spec transcode(binary(), list()) :: {:ok, any()} | ExIpfs.Api.error_response()

Transcode a multibase encoded string.

https://docs.ipfs.io/reference/http/api/#api-v0-multibase-transcode

Parameters

data - Data to transcode.

Options

b - Multibase encoding to use