JSONKit icon indicating copy to clipboard operation
JSONKit copied to clipboard

feature request: parse hex integers ("hexval": 0xFF)

Open philtre opened this issue 13 years ago • 0 comments

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] }

philtre avatar Feb 22 '12 16:02 philtre