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

BigInt version #78

Open
Daniel15 opened this issue Jul 27, 2019 · 5 comments
Open

BigInt version #78

Daniel15 opened this issue Jul 27, 2019 · 5 comments

Comments

@Daniel15
Copy link

Would be good to get BigInt support... I think the current version doesn't support BigInts.

@CatsMiaow
Copy link

@Daniel15
Copy link
Author

@CatsMiaow
Copy link

I know but BigInt doesn't work as I want.

console.log(616580508813361172); // 616580508813361200
BigInt(616580508813361172); // 616580508813361152n
616580508813361152n.toString(); // "616580508813361152"
BigInt(616580508813361172).toString(); // "616580508813361152"
BigInt(616580508813361172).toString() === "616580508813361172" // false

But as I wrote this comment, I checked again

BigInt("616580508813361172").toString() === "616580508813361172" // true

🤔

Rewritten with BigInt
https://gist.github.com/CatsMiaow/b479e96d5613dbd4711ab6d768b3eea0

@gvasquez95
Copy link

same issue here trying to encode this hex number: 5fce40b61ddd1a677bbdd9d7
back & forth get's it truncated into 5fce40b61ddd240000000000

@MrXyfir
Copy link

MrXyfir commented Aug 8, 2024

With BigInt more common nowadays, it'd definitely be nice to have this functionality

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

No branches or pull requests

5 participants