Oh come on - is there anything you do know how to do for yourself? OK, Hashes can get a little complex, but this is a trivial task that shouldn't be beyond the average beginner after the second week of his course...
Allocate a new array of bytes: in the char array is n chars, then the length should be
(n - 1) / 2 + 1
bytes.
Write a function that accepts a hex char, and returns a byte. That's pretty trivial, the simplest solution (though not the best) is a basic
switch
:
unsigned char FromHex(char c)
{
switch(c)
{
case '0': return 0;
case '1': return 1;
case '2': return 2;
case '3': return 3;
case '4': return 4;
case '5': return 5;
case '6': return 6;
case '7': return 7;
case '8': return 8;
case '9': return 9;
case 'a': return 10;
case 'b': return 11;
case 'c': return 12;
case 'd': return 13;
case 'e': return 14;
case 'f': return 15;
}
...
return -1;
}
Then loop through your char array in pairs.
Use the FromHex function to convert each character to binary, and use the Left Shift operator << to move the first result to the high byte, and binary OR iot with teh low byte:
b1 = FromHex(InputData[i++];
b2 = FromHex(INputData[i++};
b = (b1 << 4) | b2;
Then insert that byte into your output array.
30 seconds of actual thinking would have got you that: so why did you ask us?