#include <random_generator.h>
◆ RandomGenerator()
mysql_harness::RandomGenerator::RandomGenerator |
( |
| ) |
|
|
inline |
◆ generate_identifier()
std::string mysql_harness::RandomGenerator::generate_identifier |
( |
unsigned |
length, |
|
|
unsigned |
alphabet_mask = AlphabetAll |
|
) |
| |
|
overridevirtual |
Generates a random string out of selected alphabet.
- Parameters
-
length | length of string requested |
alphabet_mask | bitmasmask indicating which alphabet symbol groups should be used for identifier generation (see AlphabetContent enum for possible values that can be or-ed) |
- Returns
- string with the generated random chars
- Exceptions
-
std::invalid_argument | when the alphabet_mask is empty or invalid |
Implements mysql_harness::RandomGeneratorInterface.
◆ generate_strong_password()
std::string mysql_harness::RandomGenerator::generate_strong_password |
( |
unsigned |
length | ) |
|
|
overridevirtual |
Generates a random password that adheres to the STRONG password requirements:
- contains at least 1 digit
- contains at least 1 uppercase letter
- contains at least 1 lowercase letter
- contains at least 1 special character
- Parameters
-
length | length of requested password (should be at least 8) |
- Returns
- string with the generated password
- Exceptions
-
std::invalid_argument | when the requested length is less than 8 |
Implements mysql_harness::RandomGeneratorInterface.
◆ urng
std::mt19937 mysql_harness::RandomGenerator::urng |
|
private |
The documentation for this class was generated from the following files: