We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c709db4 commit 9f3279bCopy full SHA for 9f3279b
util/include/util/hash.h
@@ -36,18 +36,18 @@ inline std::string sha1Hash(const std::string& data_)
36
using namespace boost::uuids::detail;
37
38
sha1 hasher;
39
- unsigned int digest[5];
+ unsigned char digest[20];
40
41
hasher.process_bytes(data_.c_str(), data_.size());
42
hasher.get_digest(digest);
43
44
std::stringstream ss;
45
ss.setf(std::ios::hex, std::ios::basefield);
46
- ss.width(8);
+ ss.width(2);
47
ss.fill('0');
48
49
- for (int i = 0; i < 5; ++i)
50
- ss << digest[i];
+ for (int i = 0; i < 20; ++i)
+ ss << (int)digest[i];
51
52
return ss.str();
53
}
0 commit comments