From a9b6c98fa52b1bf58e2c84f2d9b15f828733fcc0 Mon Sep 17 00:00:00 2001 From: Daniele Kruse <dkruse@cern.ch> Date: Tue, 15 Sep 2015 17:16:08 +0200 Subject: [PATCH] Fixed the str() method of checksum to display the correct value --- common/checksum/Checksum.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/common/checksum/Checksum.cpp b/common/checksum/Checksum.cpp index 5ae4d67d71..cc8ea5abac 100644 --- a/common/checksum/Checksum.cpp +++ b/common/checksum/Checksum.cpp @@ -75,11 +75,8 @@ std::string cta::Checksum::str() const { std::ostringstream oss; if(0 < arraySize) { - const auto bytes = m_byteArray.getBytes(); - oss << "0x"; - for(uint32_t i = 0; i < arraySize; i++) { - oss << std::hex << bytes[i]; - } + uint32_t checkSumInt32 = *((uint32_t *)(m_byteArray.getBytes())); + oss << "0x" << std::hex << checkSumInt32; } return oss.str(); -- GitLab