C layer of the Random module.
Three sources, the same as the C++ side ('ethereal/cpp/random/random.hpp'):
- Fast: a per thread Mersenne Twister (mt19937_64), seeded once. Not for secrets.
- Deterministic: an mt19937_64 seeded with the value given in each call. The same seed and the same range always give the same value. The batch form gives a whole sequence from one seed.
- Secure: the operating system generator (BCryptGenRandom, getrandom, arc4random). For keys, tokens and nonces.
There is no seeded generator handle: the C++ side has none. The deterministic functions take the seed in every call, and a sequence is drawn with the batch form.
Integer ranges are inclusive on both ends. The full 64 bit range (span of 2^64 values) is refused: for 64 uniform bits use ETLC_RandomSecureBytes. Real ranges are [dMin, dMax], and both ends must be finite.
Integers from a seed are the same on every platform. Reals from a seed can differ in the last bit between compilers, because the scaling goes through 'long double'.
Every export returns 'int'. Zero is success, negative is an error. The values are part of the ABI.