Password generator example
#include <iostream>
int main(int argc, char** argv)
{
std::cout <<
"Generate '" << genertor.
flags() <<
"' password: " << genertor.
Generate() << std::endl;
std::cout <<
"Generate '" << genertor.
flags() <<
"' password: " << genertor.
Generate() << std::endl;
std::cout <<
"Generate '" << genertor.
flags() <<
"' password: " << genertor.
Generate() << std::endl;
std::cout <<
"Validate 'SomeCoolPaSsw0rd' password: " << (genertor.
Validate(
"SomeCoolPaSsw0rd") ?
"valid" :
"invalid") << std::endl;
std::cout <<
"Validate 'NotCoolPaSsw[0]rd' password: " << (genertor.
Validate(
"NotCoolPaSsw[0]rd") ?
"valid" :
"invalid") << std::endl;
std::cout <<
"Validate 'NotCoolPaSsw[0]rd' password: " << (genertor.
Validate(
"NotCoolPaSsw0rd") ?
"valid" :
"invalid") << std::endl;
return 0;
}
virtual std::password Generate() const
Generate the strong password with the current password requirements.
virtual bool Validate(std::string_view password) const
Validate the given password with the current password requirements.
PasswordFlags flags() const noexcept
Get the password flags.
Password generator definition.