Show / Hide Table of Contents

Class MultiBase

Self identifying base encodings.

Inheritance
Object
MultiBase
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
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 Source

DefaultAlgorithmName

The default multi-base algorithm is "base58btc".

Declaration
public const string DefaultAlgorithmName = "base58btc"
Field Value
Type Description
String

Methods

| Improve this Doc View Source

Decode(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 s.

Exceptions
Type Condition
FormatException

When the s can not be decoded.

| Improve this Doc View Source

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 bytes.

Exceptions
Type Condition
KeyNotFoundException

When algorithmName is not registered.

See Also

https://github.com/multiformats/multibase
  • Improve this Doc
  • View Source
Back to top Generated by DocFX