generator: add strtolowerpls method
All checks were successful
continuous-integration/drone/push Build is passing

a convenience method, transforms strings to lowercase
This commit is contained in:
surtur 2021-11-11 02:25:41 +01:00
parent b1fcc5d055
commit 73f8bd75a2
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 7 additions and 0 deletions

View File

@ -86,6 +86,11 @@ auto Generator::generate_random_data(uint n) -> string {
};
auto Generator::strtolowerpls(std::string &s) -> std::string {
std::transform(s.begin(),s.end(),s.begin(),::tolower);
return s;
}
} // namespace generator
} // namespace fortuna
#endif

View File

@ -25,6 +25,8 @@ private:
/* n is the number of random bytes to generate */
auto generate_random_data(uint n) -> string;
auto strtolowerpls(string &s) -> string;
protected:
auto get_state() -> Generator::G_state;