|
steghide
0.5.1
|
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 |
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).
|
inline |
construct a PseudoRandomSource object
| s | the seed |
get a pseudo-random value from {0,...,n-1}
| n | the range of the random value to be returned |
After calling getValue, the next getValue call will use the next state of the random number generator (analogous to the C rand() function)
|
staticprivate |
|
staticprivate |
|
private |