Class Codec
Metadata for IPFS multi-codec.
Inherited Members
Namespace: Ipfs.Registry
Assembly: Ipfs.Core.dll
Syntax
public class Codec
Remarks
IPFS assigns a unique Name and Code to codecs. See table.csv for the currently defined multi-codecs.
Properties
| Improve this Doc View SourceAll
A sequence consisting of all codecs.
Declaration
public static IEnumerable<Codec> All { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<Codec> | All the registered codecs. |
Code
The IPFS code assigned to the codec.
Declaration
public int Code { get; }
Property Value
| Type | Description |
|---|---|
| Int32 | Valid codes at https://github.com/multiformats/multicodec/blob/master/table.csv. |
Name
The name of the codec.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| String | A unique name. |
Methods
| Improve this Doc View SourceDeregister(Codec)
Remove an IPFS codec from the registry.
Declaration
public static void Deregister(Codec codec)
Parameters
| Type | Name | Description |
|---|---|---|
| Codec | codec | The Codec to remove. |
Register(String, Int32)
Register a new IPFS codec.
Declaration
public static Codec Register(string name, int code)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The name of the codec. |
| Int32 | code | The IPFS code assigned to the codec. |
Returns
| Type | Description |
|---|---|
| Codec | A new Codec. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | When the |
| ArgumentNullException | When the |
ToString()
The Name of the codec.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String | The Name of the codec. |