Open
Conversation
fboucquez
reviewed
Nov 6, 2024
| class BN { | ||
| #value | ||
|
|
||
| constructor(number, base, endian) { |
There was a problem hiding this comment.
Do we have this wrapper somewhere else? Maybe in currency? To unify I mean
Contributor
Author
There was a problem hiding this comment.
no
a fully compatible bn.js replacement is not this clean
here, bn.js usage is very limited so it can be replaced
also, this was still using bn.js@2
ChALkeR
commented
Nov 8, 2024
| this.#value = BigInt(number) | ||
| } else if (typeof number === 'string') { | ||
| if (base === 'hex') base = 16 | ||
| if (base === undefined) base = /[a-f]/.test(number) ? 16 : 10 |
Contributor
Author
There was a problem hiding this comment.
this is not actually what bn does, recheck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bn.jsv2 is very oldreplace it with a light implementation
Can be migrated to top-level native BigInt later
Let's release the version with bn.js first, and then investigate this