JSONKit
JSONKit copied to clipboard
feature request: parse hex integers ("hexval": 0xFF)
It would be really helpful to have a flag that enables parsing hexadecimal numbers, such as 0xFFCC3366 directly into NSNumber type. Right now, I use strings (eg. "FFCC3366"), which I then parse within my code using NSScanner. This is very tedious, especially when I need an array of color values.
So this:
{ "colors": [0xFF, 0xCC, 0xEE, 0xFFCC3366] }
would be equivalent to:
{ "colors": [255, 204, 238, 4291572582] }