Show / Hide Table of Contents

Class Hex

Helper class for converting between bytes and Hex encoded string values.

Inheritance
Object
Hex
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Hashgraph
Assembly: Hashgraph.dll
Syntax
public static class Hex

Methods

| Improve this Doc View Source

FromBytes(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.

| Improve this Doc View Source

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

null
.

ArgumentOutOfRangeException

If the string of characters is not valid Hex.

  • Improve this Doc
  • View Source
In This Article
Back to top .NET Client Library for Hedera Hashgraph