Class Hex
Helper class for converting between bytes and Hex encoded string values.
Inherited Members
Namespace: Hashgraph
Assembly: Hashgraph.dll
Syntax
public static class Hex
Methods
| Improve this Doc View SourceFromBytes(ReadOnlyMemory<Byte>)
Converts a blob of bytes into the corresponding hex encoded string.
Declaration
public static string FromBytes(ReadOnlyMemory<byte> bytes)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlyMemory<Byte> | bytes | Blob of bytes to turn into Hex. |
Returns
Type | Description |
---|---|
String | String value of the bytes in Hex. |
ToBytes(String)
Converts string values encoded in Hex into bytes.
Declaration
public static ReadOnlyMemory<byte> ToBytes(string hex)
Parameters
Type | Name | Description |
---|---|---|
String | hex | A string containing a series of characters in hexadecimal format. |
Returns
Type | Description |
---|---|
ReadOnlyMemory<Byte> | A blob of bytes decoded from the hex string. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | If the input string is .
|
ArgumentOutOfRangeException | If the string of characters is not valid Hex. |