- // Append the salt to the password and hash it
- QString passwordAndSalt(password + salt);
- QString hash(QCryptographicHash::hash(passwordAndSalt.toUtf8(), QCryptographicHash::Sha512).toHex());
-
- return hash + ":" + salt;
+ // Append the salt to the password, hash the result, and append the salt value
+ return sha2_512(password + salt) + ":" + salt;