UCHAR CharToHex(char* ch)
{
char Temp[2] = { 0 };
for (int i = 0; i < 2; i++)
{
if (ch[i] >= '0' && ch[i] <= '9')
{
Temp[i] = (ch[i] - '0');
}
else if (ch[i] >= 'a' && ch[i] <= 'f')
{
Temp[i] = (ch[i] - 'a');
}
else if (ch[i] >= 'A' && ch[i] <= 'F')
{
Temp[i] = (ch[i] - 'A');
}
}
return (Temp[0] << 4 & 0xf0) | (Temp[1] & 0xf);
}