This string contains 32 hexadecimal digits. So may represent 16 bytes, as well 8 shorts, as well 4 int. If you need to convert it into an array of bytes (unsigned char) try something similar to:
#include <stdio.h>
void main()
{
char hash[] = "df310c24eb35eee2af4f83bed8bee284";
char * p = hash;
const unsigned int SIZE = (sizeof(hash)-1)/2;
unsigned char arr[SIZE];
unsigned int count=0;
while (count < SIZE)
{
if (sscanf(p, "%2x", &arr[count]) != 1)
{
// handle error
}
count++;
p+=2;
}
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]