#include <stdint.h>
Go to the source code of this file.
Defines | |
#define | random_int() ((int) random_int64()) |
Get a random int. | |
#define | random_uint() ((unsigned) random_int64()) |
Get a random unsigned int. | |
#define | random_int32() ((int32_t) random_int64()) |
Get a random int32_t. | |
Functions | |
void | random_init (void) |
Initialize the random number generator. | |
int64_t | random_int64 (void) |
Get a random int64_t. | |
void | random_array (void *m, size_t l) |
Insert random data into an array. | |
void | random_hex (char *s, size_t l) |
Insert a random string in hexadecimal. |
#define random_int | ( | ) | ((int) random_int64()) |
Get a random int.
#define random_uint | ( | ) | ((unsigned) random_int64()) |
Get a random unsigned int.
#define random_int32 | ( | ) | ((int32_t) random_int64()) |
Get a random int32_t.
void random_init | ( | void | ) |
Initialize the random number generator.
Uses system PRNG devices to seed the library PRNG.
int64_t random_int64 | ( | void | ) |
Get a random int64_t.
void random_array | ( | void * | m, | |
size_t | l | |||
) |
Insert random data into an array.
m | the memory to fill. | |
l | the length of the m. |
void random_hex | ( | char * | s, | |
size_t | l | |||
) |
Insert a random string in hexadecimal.
s | the location in the string. | |
l | the number of characters to insert. Includes NUL byte! |