diff options
author | dbear496 <70439542+dbear496@users.noreply.github.com> | 2024-09-09 23:42:52 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2024-09-16 14:40:23 -0400 |
commit | f6750ed89b46926d1f0859f3b25d18ed62ac219e (patch) | |
tree | bfee3ba35d05edec387211e190eedcb75c0fa6af /src/utils.h | |
parent | a908d37ed1d5acd1ac18b66597b447bf6e94e837 (diff) | |
download | fork-ledger-f6750ed89b46926d1f0859f3b25d18ed62ac219e.tar.gz fork-ledger-f6750ed89b46926d1f0859f3b25d18ed62ac219e.tar.bz2 fork-ledger-f6750ed89b46926d1f0859f3b25d18ed62ac219e.zip |
update to Boost 1.86.0
fixes #2378
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/utils.h b/src/utils.h index bc05ff4f..09dd0993 100644 --- a/src/utils.h +++ b/src/utils.h @@ -578,14 +578,14 @@ inline int peek_next_nonws(std::istream& in) { *_p = '\0'; \ } -inline string to_hex(unsigned int * message_digest, const int len = 1) +inline string to_hex(unsigned char * message_digest, const int len = 4) { std::ostringstream buf; - for(int i = 0; i < 5 ; i++) { - buf.width(8); + for(int i = 0; i < 20 ; i++) { + buf.width(2); buf.fill('0'); - buf << std::hex << message_digest[i]; + buf << std::hex << (int)message_digest[i]; if (i + 1 >= len) break; // only output the first LEN dwords } @@ -598,9 +598,9 @@ inline string sha1sum(const string& str) sha.process_bytes(str.c_str(), str.length()); - unsigned int message_digest[5]; + unsigned char message_digest[20]; sha.get_digest(message_digest); - return to_hex(message_digest, 5); + return to_hex(message_digest, 20); } extern const string version; |