myMPD
Internal API documentation
Loading...
Searching...
No Matches
random.h File Reference

Random number generator functions based on OpenSSL. More...

#include <inttypes.h>
#include <stddef.h>
Include dependency graph for random.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

unsigned randrange (unsigned lower, unsigned upper)
 
char randchar (void)
 
void randstring (char *buffer, size_t len)
 

Detailed Description

Random number generator functions based on OpenSSL.

Function Documentation

◆ randchar()

char randchar ( void  )

Returns a random ascii char

Returns
random char

◆ randrange()

unsigned randrange ( unsigned  lower,
unsigned  upper 
)

Generates an unsigned type random number in range (inclusive lower and exclusive upper bound)

Parameters
lowerlower boundary
upperupper boundary
Returns
random number

◆ randstring()

void randstring ( char *  buffer,
size_t  len 
)

Fills the buffer with random ascii chars and NULL-terminates it.

Parameters
bufferbuffer to fill
lenlength of buffer