i tried following codes for converting a NSData to hex string values but all are wrong?
here "result" is my NSdata
i need a hex string as output but iam not getting that
NSUInteger dataLength = [result length];
NSLog(@"%d",dataLength);
NSMutableString *string = [NSMutableString stringWithCapacity:dataLength*2];
const unsigned char *dataBytes = [result bytes];
for (NSInteger idx = 0; idx < dataLength; ++idx) { [string appendFormat:@"%02x", dataBytes[idx]];
}
NSLog(@"%@",string);
how can i convert this please
UPDATES: the result data contains encrypted string .i want to convert this to hex values
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…