I need to count SHA1 checksum of NSData object. How c开发者_如何学编程an I do it?
Thanks in advance!
There is a SHA1 function in the openssl lib (link with -lcrypto linker option):
#include <openssl/sha.h>
NSMutableData *hashData = [NSMutableData dataWithLength:SHA_DIGEST_LENGTH];
SHA1([input bytes], [input length], [hashData mutableBytes]);
精彩评论