Generates a random integer sampled uniformly from the range of integers from 0 up to, but not including, the given bound.
The result is generated using the cryptographically secure random number generator, and uses rejection sampling to ensure the result is uniformly distributed.
int(upperBound)
upperBound
The upper bound of the range.
If the bound is in the range that can be represented as an integer number (that is, less than or equal to Number.MAX_SAFE_INTEGER), the result will be a number, if it’s larger, the result will be a BigInt.
A random number (number or BigInt).
random.int(15)
6
random.int(2n ** 128n)
231790083173559536705087892161067902023