Show / Hide Table of Contents

Class HexString

A codec for Hexadecimal.

Inheritance
Object
HexString
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 HexString
Remarks

A codec for a hexadecimal string, Encode(Byte[], String) and Decode(String). Adds the extension method ToHexString(Byte[], String) to encode a byte array and ToHexBuffer(String) to decode a hexadecimal String.

Methods

| Improve this Doc View Source

Decode(String)

Converts the specified String, which encodes binary data as hexadecimal digits, to an equivalent 8-bit unsigned integer array.

Declaration
public static byte[] Decode(string s)
Parameters
Type Name Description
String s

The hexadecimal string to convert.

Returns
Type Description
Byte[]

An array of 8-bit unsigned integers that is equivalent to s.

| Improve this Doc View Source

Encode(Byte[], String)

Converts an array of 8-bit unsigned integers to its equivalent hexadecimal string representation.

Declaration
public static string Encode(byte[] buffer, string format = "G")
Parameters
Type Name Description
Byte[] buffer

An array of Byte.

String format

One of the format specifiers ("G" and "x" for lower-case hex digits, or "X" for the upper-case). The default is "G".

Returns
Type Description
String

The string representation, in hexadecimal, of the contents of buffer.

| Improve this Doc View Source

ToHexBuffer(String)

Converts the specified String, which encodes binary data as a hexadecimal string, to an equivalent 8-bit unsigned integer array.

Declaration
public static byte[] ToHexBuffer(this string s)
Parameters
Type Name Description
String s

The hexadecimal string to convert.

Returns
Type Description
Byte[]

An array of 8-bit unsigned integers that is equivalent to s.

| Improve this Doc View Source

ToHexString(Byte[], String)

Converts an array of 8-bit unsigned integers to its equivalent hexadecimal string representation.

Declaration
public static string ToHexString(this byte[] buffer, string format = "G")
Parameters
Type Name Description
Byte[] buffer

An array of Byte.

String format

One of the format specifiers ("G" and "x" for lower-case hex digits, or "X" for the upper-case). The default is "G".

Returns
Type Description
String

The string representation, in hexadecimal, of the contents of buffer.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX