CommonCrypto会在iPhone设备上的我的应用程序中工作吗?
非常类似于,我希望计算字符串的MD5散列,以便在API中使用 根据,这在设备上不起作用: iPhone上没有CommonCrypto框架。不幸的是 iPhone模拟器针对Mac OS X框架进行编译,因此可以在 模拟器…但你无法为设备编译它 这样的代码还会在设备上运行吗CommonCrypto会在iPhone设备上的我的应用程序中工作吗?,iphone,objective-c,ios4,hash,Iphone,Objective C,Ios4,Hash,非常类似于,我希望计算字符串的MD5散列,以便在API中使用 根据,这在设备上不起作用: iPhone上没有CommonCrypto框架。不幸的是 iPhone模拟器针对Mac OS X框架进行编译,因此可以在 模拟器…但你无法为设备编译它 这样的代码还会在设备上运行吗 #import <CommonCrypto/CommonDigest.h> #define CC_MD5_DIGEST_LENGTH 16 /* digest length in bytes */ - (NS
#import <CommonCrypto/CommonDigest.h>
#define CC_MD5_DIGEST_LENGTH 16 /* digest length in bytes */
- (NSString *)md5:(NSString *)str {
const char *cStr = [str UTF8String];
unsigned char result[CC_MD5_DIGEST_LENGTH];
CC_MD5(cStr, strlen(cStr), result);
return [NSString stringWithFormat: @"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
result[0], result[1], result[2], result[3],
result[4], result[5], result[6], result[7],
result[8], result[9], result[10], result[11],
result[12], result[13], result[14], result[15]];
}
在设备上生成MD5哈希的最新和最佳方法是什么?
如何在XCode 4中添加CommonCrypto/CommonDigtest.h
谢谢,是的,您可以使用CommonCrypto iniOS。我在APpStore中有一个使用CommonCrypto的应用程序 使文章更完整的更多信息: 只需导入诸如
#import <CommonCrypto/CommonDigest.h>
#import <CommonCrypto/CommonHMAC.h>
#import <CommonCrypto/CommonCryptor.h>
是的,您可以使用CommonCrypto iniOS。我在APpStore中有一个使用CommonCrypto的应用程序 使文章更完整的更多信息: 只需导入诸如
#import <CommonCrypto/CommonDigest.h>
#import <CommonCrypto/CommonHMAC.h>
#import <CommonCrypto/CommonCryptor.h>
请看一下我的问题请看一下我的问题