1 #ifndef _random__hpp__included__
2 #define _random__hpp__included__
7 #include "library/string.hpp"
10 * \brief Get random hexes
12 * Get string of random hex characters of specified length.
14 * \param length The number of hex characters to return.
15 * \return The random hexadecimal string.
16 * \throws std::bad_alloc Not enough memory.
18 std::string
get_random_hexstring(size_t length
) throw(std::bad_alloc
);
21 * \brief Set random seed
23 * This function sets the random seed to use.
25 * \param seed The value to use as seed.
26 * \throw std::bad_alloc Not enough memory.
28 void set_random_seed(const std::string
& seed
) throw(std::bad_alloc
);
31 * \brief Set random seed to (hopefully) unique value
33 * This function sets the random seed to value that should only be used once. Note, the value is not necressarily
34 * crypto-secure, even if it is unique.
36 * \throw std::bad_alloc Not enough memory.
38 void set_random_seed() throw(std::bad_alloc
);
43 void random_mix_timing_entropy();
46 * 256 bits of as high quality entropy as possible.
48 void highrandom_256(uint8_t* buf
);