Secure random number generation.
◆ generate_password()
Generates a null-terminated password of length 2 * random_length.
- Parameters
-
| buffer | Pointer to the start of the output buffer. |
| length | Length of the buffer. |
| random | Pointer to a randomly-initialized array of shorts. |
| random_length | Length of the short array. |
◆ secure_rand()
Returns random int.
- Returns
- Random int.
◆ secure_rand_below()
| int secure_rand_below |
( |
int |
below | ) |
|
Returns a random nonnegative integer below the given number, with a uniform distribution.
- Parameters
-
| below | Upper limit (exclusive) of integers to return. |
- Returns
- Random nonnegative below the given number.
◆ secure_random_fill()
Fills the buffer with the specified amount of random bytes.
- Parameters
-
| buffer | Pointer to the start of the buffer. |
| length | Length of the buffer. |
◆ secure_random_password()
Fills the buffer with the specified amount of random password characters.
- Parameters
-
| buffer | Pointer to the start of the buffer. |
| length | Length of the buffer. |
| pw_length | Length of the desired password. |