3 ms·
I threw 0x2059B7DEDB800C03 (2331096449934167043) in there as a Postgres int8 I had lying around and I get the message: "The number you're encoding is bigger tha
by jarym 6y ago
I threw 0x2059B7DEDB800C03 (2331096449934167043) in there as a Postgres int8 I had lying around and I get the message: "The number you're encoding is bigger than what Javascript can accurately represent, so the below value is probably incorrect."
However, it is (now) possible to represent this in JavaScript as a BigInt[0]
[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- yellowapple 6y agoYeah, I wanted to keep the initial pass at a JS implementation as universal and dependency-free as possible, which precluded the use of BigInt for this attempt (a surprising number of JS runtimes out there don't ship with it, including both any version of Internet Explorer and the ancient version of Node.js that's the default on my system). PRs are certainly welcome if someone wants to have a go at hacking it in (on the condition that it's able to fall back to a non-BigInt approach should it be unavailable).