MINOR: tools: add a generic function to generate UUIDs

We currently have two UUID generation functions, one for the sample
fetch and the other one in the SPOE filter. Both were a bit complicated
since they were made to support random() implementations returning an
arbitrary number of bits, and were throwing away 33 bits every 64. Now
we don't need this anymore, so let's have a generic function consuming
64 bits at once and use it as appropriate.
This commit is contained in:
Willy Tarreau
2020-03-08 17:48:17 +01:00
parent aa8bbc12dd
commit ee3bcddef7
4 changed files with 29 additions and 51 deletions

View File

@@ -1551,6 +1551,7 @@ static inline void *my_realloc2(void *ptr, size_t size)
int parse_dotted_uints(const char *s, unsigned int **nums, size_t *sz);
/* PRNG */
void ha_generate_uuid(struct buffer *output);
void ha_random_seed(const unsigned char *seed, size_t len);
void ha_random_jump96(uint32_t dist);
uint64_t ha_random64();