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

Support BigInt #82

Open
betamos opened this issue Oct 27, 2019 · 2 comments · May be fixed by #128
Open

Support BigInt #82

betamos opened this issue Oct 27, 2019 · 2 comments · May be fixed by #128

Comments

@betamos
Copy link

betamos commented Oct 27, 2019

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 0

Please consider adding support for BigInt or if you'd rather accept contributions I'd be happy to take a look.

@jimmywarting
Copy link

I maybe think it should rather be suggested that BigInt is used instead of long?

@martinheidegger
Copy link

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
@ThaddeusJiang ThaddeusJiang linked a pull request Aug 28, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants