Class UtilsHex
- Namespace
- SunamoColors
- Assembly
- SunamoColors.dll
Provides utility methods for converting between byte arrays and hexadecimal string representations
public class UtilsHex
- Inheritance
-
UtilsHex
- Inherited Members
- Extension Methods
Methods
FromHex(string)
Converts a hexadecimal string representation to an array of bytes
public static List<byte> FromHex(string hexEncoded)
Parameters
hexEncodedstringThe hexadecimal string to convert (can start with #)
Returns
- List<byte>
A list of bytes representing the hexadecimal string, or empty list if the input is null or empty
Exceptions
- Exception
Thrown when the provided string does not appear to be hex encoded
ToHex(List<byte>)
Converts an array of bytes to a hexadecimal string representation
public static string ToHex(List<byte> bytes)
Parameters
Returns
- string
A hexadecimal string representation of the byte array, or empty string if the input is null or empty