summaryrefslogtreecommitdiff
path: root/absl/crc/crc32c.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2023-08-01 14:40:45 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-08-01 14:41:35 -0700
commitfc1dcc0f6a6b22f4ef4a30fc2020d4c81ab1b3c5 (patch)
treeb950bdb1c287662cb0a4c1c325a7727d4f740fa2 /absl/crc/crc32c.h
parent5b3b0ed81cb514540c3b9d752d9e01efb64056d2 (diff)
Changes absl::crc32c_t insertion operator (<<) to return value as 0-padded hex instead of dec
PiperOrigin-RevId: 552927211 Change-Id: I0375d60a9df4cdfc694fe8d3b3d790f80fc614a1
Diffstat (limited to 'absl/crc/crc32c.h')
-rw-r--r--absl/crc/crc32c.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/absl/crc/crc32c.h b/absl/crc/crc32c.h
index 79059dc1..69799c8b 100644
--- a/absl/crc/crc32c.h
+++ b/absl/crc/crc32c.h
@@ -29,6 +29,7 @@
#include <ostream>
#include "absl/crc/internal/crc32c_inline.h"
+#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
namespace absl {
@@ -175,7 +176,7 @@ crc32c_t RemoveCrc32cSuffix(crc32c_t full_string_crc, crc32c_t suffix_crc,
//
// Streams the CRC32C value `crc` to the stream `os`.
inline std::ostream& operator<<(std::ostream& os, crc32c_t crc) {
- return os << static_cast<uint32_t>(crc);
+ return os << absl::StreamFormat("%08x", static_cast<uint32_t>(crc));
}
ABSL_NAMESPACE_END