deno_std
deno_std copied to clipboard
[Suggestion] A module that includes BigInt utilities
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.