Hi guys,
I need to convert a long value from int64 to NSData, so I can later run a hash algorithm on it. I perform:
int64_t longNumber = 9000000000000000000L;
NSMutableData *buffer = [NSMutableData dataWithBytes:&longNumber length:sizeof(longNumber)];
NSLog(@"%lld", [buffer bytes]);
NSLog(@"%lld", longNumber);
The resultant console output is like this:
6201314301187184 9000000000000000000
Why is NSData not properly storing the value of the long number? If I run this in a loop, the NSData bytes drift, starting with 620, then 621 and on. Am I outputting the address of the longNumber via [buffer bytes] and not its value?