Skip to content

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

Merged
fanatid merged 1 commit intoindutny:v4.xfrom
ChALkeR:chalker/backport/0
Nov 11, 2024
Merged

backport(4.x): Fix serious issue in .toString(16) (#295)#309
fanatid merged 1 commit intoindutny:v4.xfrom
ChALkeR:chalker/backport/0

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