iPhone: SHA1 hash on ios 4.3 -


Code> - (NSString *) string string 1: (NSString *) str {const char * cstr = [str cStringUsingEncoding: NSUTF8StringEncoding]; NSDT * Data = [NSDTATA DataWithbites: Cestrate Length: str.length]; Uint8_t digest [CC_SHA1_DIGEST_LENGTH]; CC_SHA1 (data bytes, data. Length, digest); NSMutableString * Output = [NSMutableString stringWithCapacity: CC_SHA1_DIGEST_LENGTH * 2]; For (Int i = 0; I & lt; CC_SHA1_DIGEST_LENGTH; i ++) [Output Apen Format: @ "% 02x", Digest [I]]; Return output; }

It works like a magic on my iPhone device with iOS 5.0 and above, but my iPad version 4.3.5 crashes on this line

  cciha1,1 (data. Biets, data. Length, digest);   

It says the following:

dyld: idle symbol binding failed: the symbol _CC_SHA1 can not be resolved because the dependent dylib # 3 will not be loaded

dyld: The symbol _CC_SHA1 can not be solved because the dependent daibel # 3 can not be loaded

How it works on my iPad 4.3.5 device Any thoughts about doing?

If you look at the header file, you will see:

  External Unsigned Four * CCIHA1 (Constant Worth * Data, CC_Long Lane, Unsigned Four * MD) __OSX_AVAILABLE_STARTING (__MAC_10_4, __IPHONE_5_0);   

__ OSX_AVAILABLE_STARTING (...) Accessories means that this function is only available on OS X 10.4+ and iOS 5.0+. This is why your app is crashing.

Comments