Dash Core  0.12.2.1
P2P Digital Currency
random.h File Reference
#include "uint256.h"
#include <stdint.h>

Go to the source code of this file.

Classes

class  InsecureRand
 

Functions

void RandAddSeed ()
 
void RandAddSeedPerfmon ()
 
void GetRandBytes (unsigned char *buf, int num)
 
uint64_t GetRand (uint64_t nMax)
 
int GetRandInt (int nMax)
 
uint256 GetRandHash ()
 
void seed_insecure_rand (bool fDeterministic=false)
 
static uint32_t insecure_rand (void)
 

Variables

uint32_t insecure_rand_Rz
 
uint32_t insecure_rand_Rw
 

Function Documentation

◆ GetRand()

◆ GetRandBytes()

◆ GetRandHash()

uint256 GetRandHash ( )

Definition at line 114 of file random.cpp.

Referenced by CAddrMan::Clear(), LimitOrphanTxSize(), RelayAddress(), and SendMessages().

◆ GetRandInt()

◆ insecure_rand()

static uint32_t insecure_rand ( void  )
inlinestatic

◆ RandAddSeed()

void RandAddSeed ( )

Seed OpenSSL PRNG with additional entropy data

Definition at line 38 of file random.cpp.

Referenced by CInit::CInit(), and RandAddSeedPerfmon().

◆ RandAddSeedPerfmon()

void RandAddSeedPerfmon ( )

◆ seed_insecure_rand()

void seed_insecure_rand ( bool  fDeterministic = false)

Seed insecure_rand using the random pool.

Parameters
DeterministicUse a deterministic seed

Definition at line 123 of file random.cpp.

Referenced by AppInit2(), and ApproximateBestSubset().

Variable Documentation

◆ insecure_rand_Rw

uint32_t insecure_rand_Rw

Definition at line 122 of file random.cpp.

Referenced by insecure_rand(), and seed_insecure_rand().

◆ insecure_rand_Rz

uint32_t insecure_rand_Rz

MWC RNG of George Marsaglia This is intended to be fast. It has a period of 2^59.3, though the least significant 16 bits only have a period of about 2^30.1.

Returns
random value

Definition at line 121 of file random.cpp.

Referenced by insecure_rand(), and seed_insecure_rand().