random-util: add random_u64_range() that acquires a random number from a certain range, unbiased
So far we have been quite sloppy with this and ignored modulus and range bias. Let's do something about, and add the option to do better.
This commit is contained in:
@@ -40,3 +40,5 @@ int rdrand(unsigned long *ret);
|
||||
size_t random_pool_size(void);
|
||||
|
||||
int random_write_entropy(int fd, const void *seed, size_t size, bool credit);
|
||||
|
||||
int random_u64_range(uint64_t max);
|
||||
|
||||
Reference in New Issue
Block a user