C# Класс Ipfs.HexString

A codec for Hexadecimal.

A codec for a hexadecimal string, Encode and Decode. Adds the extension method ToHexString to encode a byte array and ToHexBuffer to decode a hexadecimal string.

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Decode ( string s ) : byte[]

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

Encode ( byte buffer, string format = "G" ) : string

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

ToHexBuffer ( this s ) : byte[]

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

ToHexString ( this buffer, string format = "G" ) : string

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

Описание методов

Decode() публичный статический Метод

Converts the specified string, which encodes binary data as hexadecimal digits, to an equivalent 8-bit unsigned integer array.
public static Decode ( string s ) : byte[]
s string /// The hexadecimal string to convert. ///
Результат byte[]

Encode() публичный статический Метод

Converts an array of 8-bit unsigned integers to its equivalent hexadecimal string representation.
public static Encode ( byte buffer, string format = "G" ) : string
buffer byte /// An array of 8-bit unsigned integers. ///
format string /// One of the format specifiers ("G" and "x" for lower-case hex digits, or "X" for the upper-case). /// The default is "G". ///
Результат string

ToHexBuffer() публичный статический Метод

Converts the specified string, which encodes binary data as a hexadecimal string, to an equivalent 8-bit unsigned integer array.
public static ToHexBuffer ( this s ) : byte[]
s this /// The hexadecimal string to convert. ///
Результат byte[]

ToHexString() публичный статический Метод

Converts an array of 8-bit unsigned integers to its equivalent hexadecimal string representation.
public static ToHexString ( this buffer, string format = "G" ) : string
buffer this /// An array of 8-bit unsigned integers. ///
format string /// One of the format specifiers ("G" and "x" for lower-case hex digits, or "X" for the upper-case). /// The default is "G". ///
Результат string