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

backport(4.x): Fix serious issue in .toString(16) (#295) #309

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

ChALkeR
Copy link

@ChALkeR ChALkeR commented Nov 11, 2024

This backports #295 to v4.x branch

4.x usage is still at ~75%
E.g. elliptic uses 4.x

telegram-cloud-photo-size-2-5292272682706003588-y

Original description:

* Add test for `.toString(16)`

* Fix serious issue in `.toString(16)`

The hex encoding of some numbers is wrong. Since the string representation is also used for interoperability between BigInt libraries, this bug is causing a number modification when a BN.js number is converted into another BigInt class, for example the BigNumber of ethers.js.

* Add test for `.toString(16)`

* Fix serious issue in `.toString(16)`

The hex encoding of some numbers is wrong. Since the string representation
is also used for interoperability between BigInt libraries, this bug is
causing a number modification when a BN.js number is converted into
another BigInt class, for example the BigNumber of ethers.js.
@fanatid fanatid merged commit a5f14b4 into indutny:v4.x Nov 11, 2024
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

Successfully merging this pull request may close these issues.

3 participants