secureRandom()
Calculates a sequence of secure integer pseudo random numbers.
Synopsis
int secureRandom([unsigned max = 32767]);
Parameters
Parameter | Description |
---|---|
max |
The default value for max is 32767 (backward compatibility) If the max value is greater than 0, the secureRandom function generates a random number in the range <0, max>. |
Return value
If the maximum value is higher than MAX_INT or (less than or equal to) 0, the secureRandom function returns -1.
Description
Via the function secureRandom, a sequence of secure integer pseudo random numbers in the range of 0 to 32767 can be calculated.
The function secureRandom works independent of the srand() and rand() functions and returns a secure random number of the operating system.
Example
main()
{
int i = secureRandom();
DebugN("secureRandom:", i);
}
Assignment
Miscellaneous functions
Availability
CTRL