Objective-Cリハビリ中メモ。 環境: Xcode 4.6.3, iOS 6. Objective-Cで md5, sha1, sha2 を作ってみる。 md5 // md5 +(NSString *) md5WithString:(NSString *)input { const char *cStr = [input UTF8String]; unsigned char digest[16]; CC_MD5( cStr, strlen(cStr), digest ); NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2]; for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) [output appendFormat:@