I have a Cocoa app send some data along with a SHA1 hash of that data to a Rails app which verifies that the data and the hash match, but they do not.
To be sure I have
Found the error, stupid little thing:
-CC_SHA1([self bytes], CC_SHA1_DIGEST_LENGTH, hashBytes); +CC_SHA1([self bytes], [self length], hashBytes);
I sent the length of the digest instead of the length of the data. Don't know how I could've made such a mistake – and then overlook it for hours.