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
hexEncodedstringThe hexadecimal string to convert.
Returns
IsInHexFormat(string)
Checks whether a string is in valid hexadecimal format (lowercase, no prefix characters like #).
public static bool IsInHexFormat(string text)
Parameters
textstringThe string to validate.
Returns
ToHex(List<byte>)
Converts a list of bytes to its hexadecimal string representation.
public static string ToHex(List<byte> bytes)