BuiltIn Function to Convert from Hex String to Byte
- by Ngu Soon Hui
This question is similar to the one here.
One can easily convert from hex string to byte via the following formula:
public static byte[] HexStringToBytes(string hex)
{
byte[] data = new byte[hex.Length /2];
int j = 0;
for (int i = 0; i < hex.Length; i+=2)
{
data[ j ] =…