I get the above error (in the header) when making MD5 from a file. I can usually deal with these types of 32-> 64-bit conversion problems ... but in this case I donβt know what to do, CC_MD5 is part of the CommonCrypto->CommonDigestlibrary that comes with iOS7.1. I suppose [inputData length]NSUInteger is returning, and that is the problem, but can I just drop UL to UI? I may lose accuracy if the file is large. Why is the library that Apple offers requires inta 64-bit language, such as iOS? Did someone miss something or am I really stupid and misdiagnosed the problem?
- (NSString*) getMD5FromFile:(NSString *)pathToFile {
unsigned char outputData[CC_MD5_DIGEST_LENGTH];
NSData *inputData = [[NSData alloc] initWithContentsOfFile:pathToFile];
CC_MD5([inputData bytes], [inputData length], outputData);
[inputData release];
NSMutableString *hash = [[NSMutableString alloc] init];
for (NSUInteger i = 0; i < CC_MD5_DIGEST_LENGTH; i++) {
[hash appendFormat:@"%02x", outputData[i]];
}
return [hash autorelease];
}
CommonCrypt- > CommonDigest.h:
extern unsigned char *CC_MD5(const void *data, CC_LONG len, unsigned char *md)
apple (# 17256918), ?