¡@

Home 

2014/10/15 ¤U¤È 10:11:20

iphone Programming Glossary: md5buffer

How do I create a hash of a file on iOS?

http://stackoverflow.com/questions/7632145/how-do-i-create-a-hash-of-a-file-on-ios

generateMD5Hash @end and this in your .m NSString generateMD5Hash const char string self UTF8String unsigned char md5Buffer CC_MD5_DIGEST_LENGTH CC_MD5 string strlen string md5Buffer NSMutableString output NSMutableString stringWithCapacity CC_MD5_DIGEST_LENGTH.. const char string self UTF8String unsigned char md5Buffer CC_MD5_DIGEST_LENGTH CC_MD5 string strlen string md5Buffer NSMutableString output NSMutableString stringWithCapacity CC_MD5_DIGEST_LENGTH 2 for int i 0 i CC_MD5_DIGEST_LENGTH i output.. stringWithCapacity CC_MD5_DIGEST_LENGTH 2 for int i 0 i CC_MD5_DIGEST_LENGTH i output appendFormat @ 02x md5Buffer i return output you can implement this by making a new class called NSString MD5 and inserting the code above in the corresponding..