This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString*)hexStringFromString:(NSString*)string | |
{ | |
const char *utf8 = [string UTF8String]; | |
NSMutableString *result = [NSMutableString new]; | |
for (int i = 0; i < string.length; i++) { | |
[result appendFormat:@"0x%02X, ", *utf8++ & 0x00FF]; | |
} | |
return result; | |
} |