diff --git a/code/build/security/hash.cxx b/code/build/security/hash.cxx index 8b642be..da5ff66 100644 --- a/code/build/security/hash.cxx +++ b/code/build/security/hash.cxx @@ -47,13 +47,13 @@ namespace code::build::security::hash throw runtime_error{"EVP_DigestFinal_ex() failure"}; } - string output; + std::ostringstream o; 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