Trying to Write NSString sha1 function, but it's returning null

后端 未结 4 873
有刺的猬
有刺的猬 2020-12-17 02:09

I have the following Objective-C function:

+(NSString *)stringToSha1:(NSString *)str{
    NSMutableData *dataToHash = [[NSMutableData alloc] init];
    [data         


        
4条回答
  •  眼角桃花
    2020-12-17 03:01

    glycol, You will need to define your CC_SHA1_DIGEST_LENGTH constant, probably to 20, as that's the length of an SHA-1 digest according to the NIST spec at http://www.itl.nist.gov/fipspubs/fip180-1.htm

提交回复
热议问题