Class Base32
A codec for Base-32.
Inherited Members
Namespace: Ipfs
Assembly: Ipfs.Core.dll
Syntax
public static class Base32
Remarks
A codec for Base-32, Encode(Byte[]) and Decode(String). Adds the extension method ToBase32(Byte[]) to encode a byte array and FromBase32(String) to decode a Base-32 string.
Encode(Byte[]) and ToBase32(Byte[]) produce the lower case form of https://tools.ietf.org/html/rfc4648 with no padding. Decode(String) and FromBase32(String) are case-insensitive and allow optional padding.
A thin wrapper around https://github.com/ssg/SimpleBase.
Methods
| Improve this Doc View SourceDecode(String)
Converts the specified String, which encodes binary data as base 32 digits, to an equivalent 8-bit unsigned integer array.
Declaration
public static byte[] Decode(string input)
Parameters
Type | Name | Description |
---|---|---|
String | input | The base 32 string to convert. |
Returns
Type | Description |
---|---|
Byte[] | An array of 8-bit unsigned integers that is equivalent to |
Remarks
input
is case-insensitive and allows padding.
Encode(Byte[])
Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-32 characters.
Declaration
public static string Encode(byte[] input)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | input | An array of 8-bit unsigned integers. |
Returns
Type | Description |
---|---|
String | The string representation, in base 32, of the contents of |
FromBase32(String)
Converts the specified String, which encodes binary data as base 32 digits, to an equivalent 8-bit unsigned integer array.
Declaration
public static byte[] FromBase32(this string s)
Parameters
Type | Name | Description |
---|---|---|
String | s | The base 32 string to convert; case-insensitive and allows padding. |
Returns
Type | Description |
---|---|
Byte[] | An array of 8-bit unsigned integers that is equivalent to |
ToBase32(Byte[])
Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-32 digits.
Declaration
public static string ToBase32(this byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | bytes | An array of 8-bit unsigned integers. |
Returns
Type | Description |
---|---|
String | The string representation, in base 32, of the contents of |