Crytographically relevant random numbers. More...
#include <secure.h>
Static Public Member Functions | |
static size_t | fill (unsigned char *memory, size_t size) |
Fill memory with pseudo-random values. | |
static int | get (int min, int max) |
Get a pseudo-random integer in a preset range. | |
static int | get (void) |
Get a pseudo-random integer, range 0 - 32767. | |
static size_t | key (unsigned char *memory, size_t size) |
Get high-entropy random data. | |
static double | real (double min, double max) |
Get a pseudo-random floating point value in a preset range. | |
static double | real (void) |
Get a pseudo-random floating point value. | |
static void | seed (void) |
Re-seed pseudo-random generation and entropy pools. | |
static bool | seed (unsigned char *buffer, size_t size) |
Push entropic seed. | |
static bool | status (void) |
Determine if we have sufficient entropy to return random values. | |
static String | uuid (void) |
static void | uuid (char *string) |
Create 36 character random uuid string. |
Crytographically relevant random numbers.
This is used both to gather entropy pools and pseudo-random values.
Definition at line 454 of file secure.h.
static size_t ucc::Random::fill | ( | unsigned char * | memory, | |
size_t | size | |||
) | [static] |
Fill memory with pseudo-random values.
This is used as the basis for all get and real operations and does not depend on seed entropy.
memory | buffer to fill. | |
size | of buffer to fill. |
static int ucc::Random::get | ( | int | min, | |
int | max | |||
) | [static] |
Get a pseudo-random integer in a preset range.
min | value of random integer. | |
max | value of random integer. |
static int ucc::Random::get | ( | void | ) | [static] |
Get a pseudo-random integer, range 0 - 32767.
static size_t ucc::Random::key | ( | unsigned char * | memory, | |
size_t | size | |||
) | [static] |
Get high-entropy random data.
This is often used to initialize keys. This operation may block if there is insufficient entropy immediately available.
memory | buffer to fill. | |
size | of buffer. |
static double ucc::Random::real | ( | double | min, | |
double | max | |||
) | [static] |
Get a pseudo-random floating point value in a preset range.
min | value of random floating point number. | |
max | value of random floating point number. |
static double ucc::Random::real | ( | void | ) | [static] |
Get a pseudo-random floating point value.
static bool ucc::Random::seed | ( | unsigned char * | buffer, | |
size_t | size | |||
) | [static] |
Push entropic seed.
buffer | of random data to push. | |
size | of buffer. |
static bool ucc::Random::status | ( | void | ) | [static] |
Determine if we have sufficient entropy to return random values.
static void ucc::Random::uuid | ( | char * | string | ) | [static] |
Create 36 character random uuid string.
string | to write uuid into, must be 37 bytes or more. |