Hello everyone,
I try to invoke the following code to get SHA1 working on the iPhone:
uint8_t digest[CC_SHA1_DIGEST_LENGTH] = {0};
CC_SHA1(keyData.bytes, keyData.length, digest);
keyData simply contains a constant string of hex code. However the hash hex that I get as a result of this does not match what online SHA1 generators output for the same input hex, but even more wierdly, it does not stay consistent. In other words, I run the hash function once and get one result, twice - another.
Can anyone help, or point me to what I'm doing wrong?
Thank you in advance!