restore stream falgs after printing hash

This commit is contained in:
mrbesen 2022-10-24 22:50:58 +02:00
parent 73bba13272
commit 50d09e872d
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
1 changed files with 4 additions and 0 deletions

View File

@ -116,11 +116,15 @@ std::ostream& operator<<(std::ostream& str, const Hash& rhs) {
return str << "[empty hash]";
}
std::ios_base::fmtflags flags = str.flags();
str << std::hex << std::setfill('0');
for(size_t i = 0; i < HASHSIZE; ++i) {
str << std::setw(2) << (int) rhs.data[i];
}
str.setf(flags);
return str;
}