开发者

Count SHA1 of NSData

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]);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜