0
私はMD5がstr
を暗号化を使用する場合、私は警告を取得:私は暗黙的な変換は整数精度を失い得る文字列を暗号化:「CC_LONG」から「unsigned long型」(別名「unsigned int型を」)
を暗黙の変換では整数精度が失われます: 'unsigned long'から 'CC_LONG'(別名 'unsigned int')になります。
+ (NSString *)md5To32bit:(NSString *)str {
const char *cStr = [str UTF8String];
unsigned char digest[CC_MD5_DIGEST_LENGTH];
CC_MD5(cStr, strlen(cStr),digest); // here I get the warning.
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;
}