21 Meta m(
"generator",
"random",
"Generates random strings.");
30 size_t length,
size_t seed = 0,
size_t min =
'0',
size_t max =
'9') {
33 if(!seed) seed = std::chrono::system_clock::now().time_since_epoch().count();
35 std::string s(length,0);
36 std::default_random_engine engine(seed);
37 std::uniform_int_distribution<char> dist(min, max);
39 for(
size_t i = 0; i < length; ++i) {
46 using Generator::Generator;
48 inline virtual std::string
generate()
override {
50 env().option(
"length").as_integer(),
51 env().option(
"seed").as_integer(),
52 env().option(
"min").as_integer(),
53 env().option(
"max").as_integer());
Contains the text compression and encoding framework.
void swap(IntVector< T > &lhs, IntVector< T > &rhs)
Env & env()
Provides access to the environment that the algorithm works in.
Base for string generators.