From e957fde12c4841d4095644b3a12ee99e5e1378c7 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 27 Nov 2015 20:34:42 +0000 Subject: [PATCH] Enable uppercase hash-to-string conversion. --- src/tiger.cpp | 5 ++++- src/tiger.hpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tiger.cpp b/src/tiger.cpp index a4ec3fc..44d6bb6 100644 --- a/src/tiger.cpp +++ b/src/tiger.cpp @@ -103,8 +103,11 @@ namespace din { parSizeOut = static_cast(file_size); } - std::string tiger_to_string (const TigerHash& parHash) { + std::string tiger_to_string (const TigerHash& parHash, bool parUpcase) { std::ostringstream oss; + if (parUpcase) { + oss << std::uppercase; + } oss << std::hex << std::setfill('0') << std::setw(2 * sizeof(uint64_t)) << swap_long(parHash.part_a) << std::hex << std::setfill('0') << std::setw(2 * sizeof(uint64_t)) diff --git a/src/tiger.hpp b/src/tiger.hpp index 186cb3f..5ae04c6 100644 --- a/src/tiger.hpp +++ b/src/tiger.hpp @@ -41,7 +41,7 @@ namespace din { void tiger_file ( const std::string& parPath, TigerHash& parHashFile, TigerHash& parHashDir, uint64_t& parSizeOut ); void tiger_init_hash ( TigerHash& parHash ); - std::string tiger_to_string ( const TigerHash& parHash ); + std::string tiger_to_string ( const TigerHash& parHash, bool parUpcase=false ); void tiger_data ( const std::string& parData, TigerHash& parHash ); void tiger_data ( const std::vector& parData, TigerHash& parHash ); } //namespace din