steghide  0.5.1
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
PseudoRandomSource Class Reference

this class serves as a source of reproducible (pseudo-)random numbers More...

#include <PseudoRandomSource.h>

Public Member Functions

 PseudoRandomSource (UWORD32 s)
 
UWORD32 getValue (UWORD32 n)
 

Private Attributes

UWORD32 Value
 

Static Private Attributes

static const UWORD32 A = 1367208549
 
static const UWORD32 C = 1
 

Detailed Description

To generate the random numbers, the linear congruetial method is used. 2^32 is used as modulus. The overflow in the implementation is intended (and controlled, as UWORD32 is used as datatype which always is 32 bits wide).

Constructor & Destructor Documentation

◆ PseudoRandomSource()

PseudoRandomSource::PseudoRandomSource ( UWORD32  s)
inline

construct a PseudoRandomSource object

Parameters
sthe seed

Member Function Documentation

◆ getValue()

UWORD32 PseudoRandomSource::getValue ( UWORD32  n)

get a pseudo-random value from {0,...,n-1}

Parameters
nthe range of the random value to be returned
Returns
a number >= 0 and <= n - 1

After calling getValue, the next getValue call will use the next state of the random number generator (analogous to the C rand() function)

Member Data Documentation

◆ A

const UWORD32 PseudoRandomSource::A = 1367208549
staticprivate

◆ C

const UWORD32 PseudoRandomSource::C = 1
staticprivate

◆ Value

UWORD32 PseudoRandomSource::Value
private

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