标签:
32位的MD5加密方法
- (NSString *)getMd5_32Bit_String:(NSString *)srcString{
const char * cStr = [srcString UTF8String];
unsigned char digest[CC_MD5_DIGEST_LENGTH];
CC_MD5( cStr, (CC_LONG)strlen(cStr), digest);
NSMutableString *result = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
[result appendFormat:@"%02x", digest[i]];
return result;
}
标签:
原文地址:http://www.cnblogs.com/tongyuling/p/4613652.html