Minor fix

This commit is contained in:
G.H.O.S.T 2025-01-04 00:54:22 +01:00
parent f0c0cc284a
commit 06fea88304
Signed by: G.H.O.S.T
GPG Key ID: 3BD93EABD1407B82

View File

@ -47,13 +47,13 @@ namespace code::build::security::hash
throw runtime_error{"EVP_DigestFinal_ex() failure"}; throw runtime_error{"EVP_DigestFinal_ex() failure"};
} }
string output; std::ostringstream o;
for (unsigned int i{0}; i < length_of_hash; ++i) { for (unsigned int i{0}; i < length_of_hash; ++i) {
output.push_back(hash[i]); o << std::setw(2) << std::setfill('0') << std::hex << (int)hash[i];
} }
return output; return o.str();
} }
} // namespace code::build::security::hash } // namespace code::build::security::hash