+static unsigned char ParseHexadecimal(char digit1, char digit2)
+{
+ unsigned char i1, i2;
+
+ if (digit1 >= 'a')
+ i1 = digit1 - 'a' + 0x0A;
+ else if (digit1 >= 'A')
+ i1 = digit1 - 'A' + 0x0A;
+ else
+ i1 = digit1 - '0';
+ if (digit2 >= 'a')
+ i2 = digit2 - 'a' + 0x0A;
+ else if (digit2 >= 'A')
+ i2 = digit2 - 'A' + 0x0A;
+ else
+ i2 = digit2 - '0';
+ return (0x10 * i1 + i2);
+}
+