#include <RandomSource.h>
Public Member Functions | |
RandomSource (void) | |
~RandomSource (void) | |
BYTE | getByte (void) |
std::vector< BYTE > | getBytes (unsigned int n) |
BitString | getBits (unsigned int n) |
bool | getBool (void) |
unsigned long | getValue (unsigned long n) |
Private Attributes | |
unsigned int | RandomBytePos |
BYTE | RandomByte |
FILE * | RandomInput |
RandomSource::RandomSource | ( | void | ) |
RandomSource::~RandomSource | ( | void | ) |
BYTE RandomSource::getByte | ( | void | ) |
get a random byte
std::vector< BYTE > RandomSource::getBytes | ( | unsigned int | n | ) |
get n random bytes
n | the number of requested random bytes |
BitString RandomSource::getBits | ( | unsigned int | n | ) |
get n random bits
n | the number of requested random bits |
bool RandomSource::getBool | ( | void | ) |
get a boolean value
unsigned long RandomSource::getValue | ( | unsigned long | n | ) |
get a random value
n | the range of the random value to be returned |
unsigned int RandomSource::RandomBytePos [private] |
BYTE RandomSource::RandomByte [private] |
FILE* RandomSource::RandomInput [private] |
determines the random input - is either opened file pointer to /dev/urandom or NULL (the rand() function is then used as random source)