View Source MyspaceIPFS.Multibase (Myspace IPFS v0.2.0-alpha.2)

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

Link to this section Summary

Types

A multibase codec.

A multibase encoding.

Functions

Decode a multibase encoded string.

Decode a multibase encoded string.

Decode a multibase encoded file.

Encode a string to a multibase encoded string.

List available multibase encodings.

Transcode a multibase encoded string.

Link to this section Types

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

A multibase codec.

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

A multibase encoding.

Link to this section Functions

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

Decode a multibase encoded string.

parameters

Parameters

data - Data to decode.

@spec decode!(binary()) :: any() | MyspaceIPFS.Api.error_response()
@spec decode!(list()) :: any() | MyspaceIPFS.Api.error_response()
@spec decode!(tuple()) :: any() | MyspaceIPFS.Api.error_response()

Decode a multibase encoded string.

parameters

Parameters

data - Data to decode.

@spec decode_file(Path.t()) :: {:ok, any()} | MyspaceIPFS.Api.error_response()

Decode a multibase encoded file.

parameters

Parameters

data - File to decode.

Link to this function

encode(data, opts \\ [])

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

encode!(data, opts \\ [])

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

Encode a string to a multibase encoded string.

parameters

Parameters

data - File to encode.

options

Options

b - Multibase encoding to use.

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

List available multibase encodings.

options

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()} | MyspaceIPFS.Api.error_response()

Transcode a multibase encoded string.

parameters

Parameters

data - Data to transcode.

options

Options

b - Multibase encoding to use