Browse Source

common: expose pseudorand_double

pr-2587
Simon Vrouwe 6 years ago
committed by Rusty Russell
parent
commit
06a062f36b
  1. 7
      common/pseudorand.c
  2. 6
      common/pseudorand.h

7
common/pseudorand.c

@ -44,6 +44,13 @@ uint64_t pseudorand_u64(void)
return isaac64_next_uint64(&isaac64);
}
double pseudorand_double(void)
{
init_if_needed();
return isaac64_next_double(&isaac64);
}
const struct siphash_seed *siphash_seed(void)
{
init_if_needed();

6
common/pseudorand.h

@ -13,6 +13,12 @@ uint64_t pseudorand(uint64_t max);
*/
uint64_t pseudorand_u64(void);
/**
* pseudorand - pseudo (guessable!) random number between 0 (inclusive) and 1
* (exclusive).
*/
double pseudorand_double(void);
/**
* Get the siphash seed for hash tables.
*/

Loading…
Cancel
Save