View Source ExIpfs.Cid (Elixir IPFS v0.1.7)

ExIpfs.Cid is where the cid commands of the IPFS API reside.

Summary

Types

A v1 CID. This is the new Base32 CID format, which is likely to last and is preferred.

Functions

Convert to base32 CID version 1.

List available multibase encodings.

List available CID codecs.

Format and convert a CID in various useful ways.

List available Multihashes.

Types

@type base32cid() :: %ExIpfs.CidBase32CID{
  cid_str: binary(),
  error_msg: binary(),
  formatted: binary()
}

A v1 CID. This is the new Base32 CID format, which is likely to last and is preferred.

Functions

@spec base32(binary()) :: {:ok, base32cid()} | ExIpfs.Api.error_response()

Convert to base32 CID version 1.

Parameters

https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-cid-base32 cid - The CID to convert to base32.

@spec bases(list()) :: {:ok, list()} | ExIpfs.Api.error_response()

List available multibase encodings.

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

List available CID codecs.

Options

https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-cid-codecs

numeric <bool> - Show codec numeric code. supported <bool> - Show only supported codecs.

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

Format and convert a CID in various useful ways.

Parameters

cid - The CID to format and convert.

Options

https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-cid-format f <string> - printf style format string. Default: %s. v <string> - CID version. b <string> - Multibase to display CID in. mc <string> - Multicodec.

@spec hashes(list()) :: {:ok, ExIpfs.multi_hash()} | ExIpfs.Api.error_response()

List available Multihashes.

Options

https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-cid-hashes

supported <bool> - Show only supported hashes.