[Suggestion] A module that includes BigInt utilities
Open
feedback welcome
- Dominant language
- TypeScript
- Stars
- 3.6k
- Forks
- 681
- PR merge metrics
- No merged PRs in 30d
Description
BigInt utilities include, but are not limited to:
- A function that takes in x, y, z, and calculates a (x ** y) % z to power, like Python’s built-in `pow`. Why not just do (x ** y) % z? Because it is really slow for large ints, and there are faster ways.
- A function that converts Uint8Arrays to BigInts (with support for signed BigInts).
- A function that converts BigInts to Uint8Arrays (with support for signed BigInts).
- A function that takes n, and returns a random BigInt that has a maximum byte length of n.
- A function that takes min, max, and returns a random BigInt in that range.
- Alternative to Math.min, Math.max.
Contributor guide
Assessment
This issue has not been assessed yet.