38 #ifndef included_random_h 39 #define included_random_h 70 *seed = (1664525 * *seed) + 1013904223;
78 {
return 0xffffffff; }
90 #ifdef CLIB_LINUX_KERNEL 92 #include <linux/sched.h> 100 #ifdef CLIB_STANDALONE 145 u8 * alphabet = (
u8 *)
"abcdefghijklmnopqrstuvwxyz";
150 for (i = 0; i < len; i++)
sll srl srl sll sra u16x4 i
always_inline u8 * random_string(u32 *seed, uword len)
Generate random character vector.
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V...
always_inline u32 random_u32(u32 *seed)
32-bit random number generator
always_inline f64 random_f64(u32 *seed)
Generate f64 random number in the interval [0,1].
always_inline uword random_default_seed(void)
Default random seed (unix/linux user-mode)
always_inline uword random_uword(u32 *seed)
machine word size random number generator
always_inline u32 random_u32_max(void)
Maximum value returned by random_u32()
always_inline u64 random_u64(u32 *seed)
64-bit random number generator
u32 standalone_random_default_seed
int test_random_main(unformat_input_t *input)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".