Objective-C Base decimal value 16 Hexadecimal conversion

Does anyone have a piece of code or a class that takes a long time and turns it into a 16-byte hexadecimal string?

I am looking for data like this

long long decimalRepresentation = 1719886131591410351;

and turn it into this

//Base 16 Hex Output: 17DE435307A07300

The% x operator does not want to work for me

NSLog(@"Hex: %x",decimalRepresentation);
//console : "Hex: 7a072af"

As you can see, this is not even close. Any help really appreciated!

+5
source share
1 answer

%xprints an unsigned integer in hexadecimal and sizeof(long long) != sizeof(unsigned). See “Data Type Size and Alignment” in the 64-bit transition guide.

ll ( L), :

NSLog(@"%llx", myLongLong); 
+10

All Articles