Table of Contents

Class HexHelper

Namespace
SunamoShared.Helpers.Number
Assembly
SunamoShared.dll

Provides helper methods for hexadecimal conversion and validation.

public static class HexHelper
Inheritance
HexHelper
Inherited Members

Methods

FromHex(string)

Converts a hexadecimal string to a list of bytes. Throws if the format is invalid (e.g. odd number of characters).

public static List<byte> FromHex(string hexEncoded)

Parameters

hexEncoded string

The hexadecimal string to convert.

Returns

List<byte>

IsInHexFormat(string)

Checks whether a string is in valid hexadecimal format (lowercase, no prefix characters like #).

public static bool IsInHexFormat(string text)

Parameters

text string

The string to validate.

Returns

bool

ToHex(List<byte>)

Converts a list of bytes to its hexadecimal string representation.

public static string ToHex(List<byte> bytes)

Parameters

bytes List<byte>

The list of bytes to convert.

Returns

string