LIPH's C++ Codes
liph::random Struct Reference

#include <random.h>

Static Public Member Functions

static bool next_bytes (void *ptr, size_t n)
 generate random n bytes More...
 
static int32_t next_int32 ()
 generate random int32_t More...
 
static uint32_t next_uint32 ()
 generate random uint32_t More...
 
static int64_t next_int64 ()
 generate random int64_t More...
 
static uint64_t next_uint64 ()
 generate random uint64_t More...
 
static float next_float ()
 generate random float More...
 
static double next_double ()
 generate random double More...
 
static int32_t gen_int (int32_t n)
 
static int32_t gen_int (int32_t a, int32_t b)
 
static double gen_real ()
 generate double range [0, 1) More...
 
static std::string gen_str (size_t size, std::string_view charset="0123456789")
 generate random string of length size from charset More...
 

Member Function Documentation

◆ gen_int() [1/2]

static int32_t liph::random::gen_int ( int32_t  a,
int32_t  b 
)
inlinestatic

generate random int32_t range [a, b) if a >= b, return a

◆ gen_int() [2/2]

static int32_t liph::random::gen_int ( int32_t  n)
inlinestatic

generate random int32_t range [0, n) if n <= 0, return 0

◆ gen_real()

static double liph::random::gen_real ( )
inlinestatic

generate double range [0, 1)

◆ gen_str()

std::string liph::random::gen_str ( size_t  size,
std::string_view  charset = "0123456789" 
)
static

generate random string of length size from charset

◆ next_bytes()

bool liph::random::next_bytes ( void *  ptr,
size_t  n 
)
static

generate random n bytes

◆ next_double()

static double liph::random::next_double ( )
inlinestatic

generate random double

◆ next_float()

static float liph::random::next_float ( )
inlinestatic

generate random float

◆ next_int32()

static int32_t liph::random::next_int32 ( )
inlinestatic

generate random int32_t

◆ next_int64()

static int64_t liph::random::next_int64 ( )
inlinestatic

generate random int64_t

◆ next_uint32()

static uint32_t liph::random::next_uint32 ( )
inlinestatic

generate random uint32_t

◆ next_uint64()

static uint64_t liph::random::next_uint64 ( )
inlinestatic

generate random uint64_t


The documentation for this struct was generated from the following files: