Re:Twitter Starts Rolling Out Option To Download Your Twitte...
by napoleond on Sunday December 16, 2012 @07:37PM
(#4930247)
Does anyone know the purpose of having both the "id" and "id_str" attributes?
[ Parent
| on HN ]
Re:Twitter Starts Rolling Out Option To Download Your Twitte...
by russss on Sunday December 16, 2012 @07:47PM
(#4930286)
It's probably because modern tweet IDs are larger than a 32-bit integer. Presumably some JSON parsers aren't too hot on parsing bigints, so they give you the option of having a string instead.
Re:Twitter Starts Rolling Out Option To Download Your Twitte...
by napoleond on Sunday December 16, 2012 @09:07PM
(#4930492)
Ahh, that makes sense. Thanks! (And thanks to andrewf as well!)
Re:Twitter Starts Rolling Out Option To Download Your Twitte...
by hythloday on Monday December 17, 2012 @10:39AM
(#4932662)
In Javascript (as well as Lua and PHP) ints are -- under the hood -- doubles. This means they can only represent a 53-bit int: outside that range they start to alias. You can see this in effect in a JS REPL:
10000000000000001 === 10000000000000000 True