Turnstone Operating System
Loading...
Searching...
No Matches
random.64.c File Reference

Random number generator using xoroshiro algorithms. More...

#include <random.h>
#include <xxhash.h>

Functions

 MODULE ("turnstone.lib.random")
 
uint64_t random_xoroshiro_state_next (void)
 
uint64_t random_xoroshiro_next (void)
 
static uint64_t random_xoroshiro_rotl (const uint64_t x, int k)
 
void srand (uint64_t seed)
 initialize random generator More...
 
uint32_t rand (void)
 generates random More...
 
uint64_t rand64 (void)
 generates random More...
 

Variables

uint64_t random_xoroshiro_seed = 0
 
uint64_t random_xoroshiro_state [4] = {}
 

Detailed Description

Random number generator using xoroshiro algorithms.

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.

Function Documentation

◆ rand()

uint32_t rand ( void  )

generates random

Returns
32 bit random number

◆ rand64()

uint64_t rand64 ( void  )

generates random

Returns
64 bit random number

◆ srand()

void srand ( uint64_t  seed)

initialize random generator

Parameters
[in]seedrandom generator seed