Class MultiBase
Self identifying base encodings.
Inherited Members
Namespace: Ipfs
Assembly: Ipfs.Core.dll
Syntax
public static class MultiBase
Remarks
MultiBase is a protocol for distinguishing base encodings
and other simple string encodings.
See the MultiBaseAlgorithm for supported algorithms.
Fields
| Improve this Doc View SourceDefaultAlgorithmName
The default multi-base algorithm is "base58btc".
Declaration
public const string DefaultAlgorithmName = "base58btc"
Field Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceDecode(String)
Converts the specified String, which encodes binary data, to an equivalent 8-bit unsigned integer array.
Declaration
public static byte[] Decode(string s)
Parameters
Type | Name | Description |
---|---|---|
String | s | The multi-base string to convert. |
Returns
Type | Description |
---|---|
Byte[] | An array of 8-bit unsigned integers that is equivalent to |
Exceptions
Type | Condition |
---|---|
FormatException | When the |
Encode(Byte[], String)
Converts an array of 8-bit unsigned integers to its equivalent string representation.
Declaration
public static string Encode(byte[] bytes, string algorithmName = "base58btc")
Parameters
Type | Name | Description |
---|---|---|
Byte[] | bytes | An array of 8-bit unsigned integers. |
String | algorithmName | The name of the multi-base algorithm to use. See https://github.com/multiformats/multibase/blob/master/multibase.csv. |
Returns
Type | Description |
---|---|
String | A String starting with the algorithm's Code and
followed by the encoded string representation of the |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | When |