internal static byte[] HexToBytes(this string src)
{
if (src.Length % 2 == 1)
src = src.PadLeft(src.Length + 1, '0');
byte[] result = new byte[src.Length / 2];
for (int i = 0, s = 0; i < result.Length; i++, s += 2)
{
result[i] = byte.Parse(src.Substring(s, 2), NumberStyles.HexNumber);
}
return result;
}