some refactoring

This commit is contained in:
loki
2021-06-08 22:10:42 +02:00
parent c53564dd31
commit 61b195e9f4
4 changed files with 49 additions and 55 deletions

View File

@@ -68,8 +68,8 @@ int generate_user_creds(const std::string &file) {
pt::ptree outputTree;
try {
std::string username = "sunshine";
std::string plainPassword = crypto::rand_string(16);
std::string salt = crypto::rand_string(16);
std::string plainPassword = crypto::rand_alphabet(16);
std::string salt = crypto::rand_alphabet(16);
outputTree.put("username", "sunshine");
outputTree.put("salt", salt);
outputTree.put("password", util::hex(crypto::hash(plainPassword + salt)).to_string());