// #import <CommonCrypto/CommonDigest.h>
-(NSString *)md5:(NSString *)str
{
const char *cStr = [str UTF8String];
unsigned char result[16];
CC_MD5(cStr, strlen(cStr), result);
NSMutableString *hash = [NSMutableString string];
for (int i = 0; i < 16; i++)
{
[hash appendFormat:@"%02X", result[i]];
}
return [hash lowercaseString];
}
iOS MD5加密
最新推荐文章于 2022-01-20 10:27:44 发布