SHA1 hashes not matching between my Rails and Cocoa apps SHA1 hashes not matching between my Rails and Cocoa apps objective-c objective-c

SHA1 hashes not matching between my Rails and Cocoa apps


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.