Skip to content

Commit

Permalink
Improve file_hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Jul 29, 2024
1 parent b866aa1 commit f8f2df7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions proxy/include/proxy/proxy_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3695,12 +3695,12 @@ R"x*x*x(<html>
while (file.read(bufs.data(), buf_size) || file.gcount())
sha1.process_bytes(bufs.data(), file.gcount());

unsigned int hash[5];
sha1.get_digest(*((boost::uuids::detail::sha1::digest_type*)&hash));
boost::uuids::detail::sha1::digest_type hash;
sha1.get_digest(hash);

std::stringstream ss;
for (int i = 0; i < 5; ++i)
ss << std::hex << std::setfill('0') << std::setw(8) << hash[i];
for (auto const& c : hash)
ss << std::hex << std::setfill('0') << std::setw(2) << static_cast<int>(c);

return ss.str();
}
Expand Down

0 comments on commit f8f2df7

Please sign in to comment.