SHA1 for Specific String in iOS
问题 According to my requirement: The input string has to be converted into Byte Values. Each character of string , which are 16 bit values , has to be converted to low 8 bits. The Sha1 is then computed over the byte Array. The resulting SHA-1 is converted into a 40 character string. I know how to convert a string into SHA1 , but the rest of part is a bit gloomy to me. I have been able to do the last two steps. unsigned char digest[CC_SHA1_DIGEST_LENGTH]; NSData *dataString = [yourString