20 #include "mongo/platform/cstdint.h"
43 return static_cast<uint32_t
>(nextInt32()) % static_cast<uint32_t>(max);
50 return static_cast<uint64_t
>(nextInt64()) % static_cast<uint64_t>(max);
59 if (
sizeof(intptr_t) == 4)
60 return static_cast<intptr_t
>(nextInt32(static_cast<int32_t>(max)));
61 return static_cast<intptr_t
>(nextInt64(static_cast<int64_t>(max)));
65 void _init(uint32_t seed);
67 uint32_t nextUInt32();
84 virtual int64_t nextInt64() = 0;
More secure random numbers Suitable for nonce/crypto Slower than PseudoRandom, so only use when reall...
Definition: random.h:80
Utility functions for parsing numbers from strings.
Definition: compare_numbers.h:20
int64_t nextInt64(int64_t max)
Definition: random.h:49
intptr_t operator()(intptr_t max)
Definition: random.h:58
int32_t nextInt32(int32_t max)
Definition: random.h:42
Uses http://en.wikipedia.org/wiki/Xorshift.
Definition: random.h:27