cctools
random.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014- The University of Notre Dame
3  * This software is distributed under the GNU General Public License.
4  * See the file COPYING for details.
5  */
6 
7 #ifndef RANDOM_H
8 #define RANDOM_H
9 
10 #include <stdint.h>
11 
19 void random_init (void);
20 
25 #define random_int() ((int) random_int64())
26 
31 #define random_int32() ((int32_t) random_int64())
32 
37 int64_t random_int64 (void);
38 
44 void random_array (void *m, size_t l);
45 
51 void random_hex (char *s, size_t l);
52 
53 #endif
54 
55 /* vim: set noexpandtab tabstop=4: */
void random_init(void)
Initialize the random number generator.
int64_t random_int64(void)
Get a random int64_t.
void random_hex(char *s, size_t l)
Insert a random string in hexadecimal.
void random_array(void *m, size_t l)
Insert random data into an array.