沙盒文件
NSString *docment = [NSSearchPathForDirectoriesInDomains(NSDesktopDirectory, NSUserDomainMask, YES)objectAtIndex:0];
NSArray *array = @[@"1",@"2"];
NSString *str1Path = [docment stringByAppendingPathComponent:@"array.plist"];
[array writeToFile:str1Path atomically:YES];
创建NSData对象
NSData *data = [NSData dataWithContentsOfFile:str1Path];
// 1 : 创建一个MD5的对象
CC_MD5_CTX md5;
// 2 : 初始化MD5对象
CC_MD5_Init(&md5);
// 3 : 准备MD5加密
CC_MD5_Update(&md5, data.bytes, (CC_LONG)data.length);
// 4: 准备一个字符串数组,存储MD5加密之后的数据
unsigned char resly[CC_MD5_DIGEST_LENGTH];
// 5: 结束MD5的加密
CC_MD5_Final(resly, &md5);
NSMutableString *resulString = [NSMutableString string];
for (int i = 0; i< CC_MD5_DIGEST_LENGTH; i++) {
[resulString appendFormat:@"%02X", resly[i]];
}
NSLog(@"result ==== %@", resulString);
}