random.h
Go to the documentation of this file.
/*
* Copyright (C) 2022 The University of Notre Dame
* This software is distributed under the GNU General Public License.
* See the file COPYING for details.
*/
#ifndef RANDOM_H
#define RANDOM_H
#include <stdint.h>
#include <stdlib.h>
void random_init (void);
#define random_int() ((int) random_int64())
#define random_uint() ((unsigned) random_int64())
#define random_int32() ((int32_t) random_int64())
int64_t random_int64 (void);
double random_double (void);
void random_array (void *m, size_t l);
void random_hex (char *s, size_t l);
#endif
/* vim: set noexpandtab tabstop=8: */
random_array
void random_array(void *m, size_t l)
Insert random data into an array.
random_double
double random_double(void)
Get a random double from (0, 1).
random_int64
int64_t random_int64(void)
Get a random int64_t.
random_hex
void random_hex(char *s, size_t l)
Insert a random string in hexadecimal.
random_init
void random_init(void)
Initialize the random number generator.