Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

int64 fields turns into Object #50

Closed
filipednb opened this issue Aug 28, 2013 · 2 comments
Closed

int64 fields turns into Object #50

filipednb opened this issue Aug 28, 2013 · 2 comments

Comments

@filipednb
Copy link

Im trying to encode some objects.. but int64 fields insists in turn to Object with high, low and unsigned properties.. server is nothing expecting int64 with this format.. Already removed Long.js

@dcodeIO
Copy link
Member

dcodeIO commented Aug 28, 2013

In JavaScript there are no full 64 bit numbers, that's why ProtoBuf.js uses Long.js. Without Long.js, you cannot use int64 at all. To convert a Long to a JavaScript number (with possible loss of information if the value is too large) you may use Long#toNumber() or, to convert it to a numerical string which is safe, Long#toString().

See: https://github.com/dcodeIO/Long.js

@filipednb
Copy link
Author

Thanks again, dcodeIO.. God Bless

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants