Loading...
Searching...
No Matches
Data Structures | Functions
as_random.h File Reference
#include <aerospike/as_std.h>
+ Include dependency graph for as_random.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  as_random
 

Functions

static void as_random_get_bytes (uint8_t *bytes, uint32_t len)
 
static void as_random_get_str (char *str, uint32_t len)
 
static uint32_t as_random_get_uint32 (void)
 
static uint64_t as_random_get_uint64 (void)
 
AS_EXTERN void as_random_init (as_random *random)
 
AS_EXTERN as_randomas_random_instance (void)
 
AS_EXTERN void as_random_next_bytes (as_random *random, uint8_t *bytes, uint32_t len)
 
AS_EXTERN void as_random_next_str (as_random *random, char *str, uint32_t len)
 
static uint32_t as_random_next_uint32 (as_random *random)
 
static uint64_t as_random_next_uint64 (as_random *random)
 

Function Documentation

◆ as_random_get_bytes()

static void as_random_get_bytes ( uint8_t * bytes,
uint32_t len )
inlinestatic

Get random bytes of specified length from thread local instance.

Definition at line 109 of file as_random.h.

References as_random_instance(), and as_random_next_bytes().

◆ as_random_get_str()

static void as_random_get_str ( char * str,
uint32_t len )
inlinestatic

Get null terminated random alphanumeric string of specified length from thread local random instance. String buffer must include space for extra null byte.

Definition at line 127 of file as_random.h.

References as_random_instance(), and as_random_next_str().

◆ as_random_get_uint32()

static uint32_t as_random_get_uint32 ( void )
inlinestatic

Get random unsigned 32 bit integer from thread local instance.

Definition at line 94 of file as_random.h.

References as_random_get_uint64().

◆ as_random_get_uint64()

static uint64_t as_random_get_uint64 ( void )
inlinestatic

Get random unsigned 64 bit integer from thread local instance.

Definition at line 84 of file as_random.h.

References as_random_instance(), and as_random_next_uint64().

◆ as_random_init()

AS_EXTERN void as_random_init ( as_random * random)

Initialize random instance.

◆ as_random_instance()

AS_EXTERN as_random * as_random_instance ( void )

Get thread local random instance.

◆ as_random_next_bytes()

AS_EXTERN void as_random_next_bytes ( as_random * random,
uint8_t * bytes,
uint32_t len )

Get random bytes of specified length from given as_random instance.

◆ as_random_next_str()

AS_EXTERN void as_random_next_str ( as_random * random,
char * str,
uint32_t len )

Get null terminated random alphanumeric string of specified length using given as_random instance. String buffer must include space for extra null byte.

◆ as_random_next_uint32()

static uint32_t as_random_next_uint32 ( as_random * random)
inlinestatic

Get random unsigned 32 bit integer from given as_random instance.

Definition at line 75 of file as_random.h.

References as_random_next_uint64().

◆ as_random_next_uint64()

static uint64_t as_random_next_uint64 ( as_random * random)
inlinestatic

Get random unsigned 64 bit integer from given as_random instance using xorshift128+ algorithm: http://xorshift.di.unimi.it

Definition at line 60 of file as_random.h.

References as_random::seed0, and as_random::seed1.