开发者

Count SHA1 of NSData

开发者 https://www.devze.com 2023-01-23 10:04 出处:网络
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):

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

精彩评论

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