Code Monkey home page Code Monkey logo

Comments (3)

jnovack avatar jnovack commented on August 24, 2024

Node seems to be able to handle it. It's probably something in the coding.. time to dive. :/

$ node
> s = 130990020780514880;
130990020780514880
> o = { s: 130990020780514880 }
{ s: 130990020780514880 }
> new Date(s / 10000 - 11644473600000);
Wed Feb 03 2016 14:41:18 GMT-0500 (EST)
> new Date(o.s / 10000 - 11644473600000);
Wed Feb 03 2016 14:41:18 GMT-0500 (EST)
> console.log(s);
130990020780514880
undefined
> console.log(o.s);
130990020780514880
undefined
> console.log(o);
{ s: 130990020780514880 }
undefined
> console.log(JSON.stringify(o));
{"s":130990020780514880}
undefined
> JSON.parse(JSON.stringify(o));
{ s: 130990020780514880 }
> j = JSON.parse(JSON.stringify(o));
{ s: 130990020780514880 }
> j
{ s: 130990020780514880 }
> new Date(j.s / 10000 - 11644473600000);
Wed Feb 03 2016 14:41:18 GMT-0500 (EST)

from heroprotocoljs.

jnovack avatar jnovack commented on August 24, 2024

The number is passing through VersionDecoder.prototype._vint in decoders.js, my guess is incorrectly, despite the function being exactly the same as the python version.

Python 2 (I have ZERO experience in Python) says "int" is a signed 32-bit, so that doesn't make much sense that it's a 64-bit number, unless Python does some magic that auto-converts it.

It looks like the VersionDecoder.prototype._vint function in decoders.js will need a shim.

from heroprotocoljs.

jnovack avatar jnovack commented on August 24, 2024

Fix is in jnovack/heroprotocoljs#long branch and can be applied once #37 is accepted.

from heroprotocoljs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.