-
Notifications
You must be signed in to change notification settings - Fork 205
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
Support BigInt #82
Labels
Comments
I maybe think it should rather be suggested that BigInt is used instead of long? |
In longfn I implemented BigInt for the from/toBytes methods: toBigInt(fromBytesLE(bytes,...)) But independently of that, I think it is a good idea to have a int64 implementation handy when needing to be computationally compatible to other implementations. With BigInt buffer overflows don't exist... |
ThaddeusJiang
added a commit
to ThaddeusJiang/long.js
that referenced
this issue
Aug 28, 2023
resolve dcodeIO#82
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The builtin BigInt type is supported in many browsers and in NodeJS (such as the fs.stat API).
Current behavior is particularly spurious and can cause bugs:
Long.fromValue(55n)
results in 0Please consider adding support for BigInt or if you'd rather accept contributions I'd be happy to take a look.
The text was updated successfully, but these errors were encountered: