This class provides all secure random rutines.
More...
#include <rand.h>
This class provides all secure random rutines.
The Rand constructor generate a new random seed.
- Returns
- Rand object
- Parameters
-
Generate | a new seed using some black magic |
- Returns
- (float)seed
seed = (float)( (usecs.tv_usec + getpid()) ^ (int(Rand::getTicks()) << 16) / 10000 );
- Parameters
-
- Returns
- (char)rnd
Get a random [A-Z] char.
- Returns
- (char)rnd
int Rand::getNumber |
( |
int |
a | ) |
|
Get a random number.
- Parameters
-
- Returns
- (int)rnd
Random sed getter.
- Returns
- (float)seed
unsigned long Rand::getTicks |
( |
| ) |
|
This function get the tick number from the CPU.
- Returns
- (ulong)tsc
In ix86 and amd64 uses RDTSC to get the low ticks value.
In ARMv6 and ARMv7 currently uses a gettimeofday()
void Rand::setSeed |
( |
float |
a | ) |
|
Random seed setter.
- Parameters
-
The documentation for this class was generated from the following files: