Re: MD5 Checksum of a file with CommonDigest.h

2008-11-20 Thread Robert Martin
I use CocoaCryptoHashing - which you can find at: http://github.com/ddfreyne Works like a charm. On Nov 20, 2008, at 5:22 PM, Andrew Farmer wrote: On 20 Nov 08, at 14:12, Sebastian Pape wrote: Hi, I'm trying to get a MD5 Checksum of a file. This is my code: [...] CC_MD5(cStr, strlen(cStr

Re: MD5 Checksum of a file with CommonDigest.h

2008-11-20 Thread Andrew Farmer
On 20 Nov 08, at 14:12, Sebastian Pape wrote: Hi, I'm trying to get a MD5 Checksum of a file. This is my code: [...] CC_MD5(cStr, strlen(cStr), result); Does your file contain any null bytes? If so, strlen() will return the wrong length. (It'll just return the length of everything up to th

MD5 Checksum of a file with CommonDigest.h

2008-11-20 Thread Sebastian Pape
Hi, I'm trying to get a MD5 Checksum of a file. This is my code: __ #import - (NSString*)getMD5ChecksumOfFile:(NSString*)pathOfFile { const char *cStr = [[NSData dataWithContentsOfFile:pathOfFile] bytes]; unsigned char result[CC_MD5_DIGEST_LENGTH];