diff --git a/src/lib/hash-util.hh b/src/lib/hash-util.hh index 3f41fc6f..a438578d 100644 --- a/src/lib/hash-util.hh +++ b/src/lib/hash-util.hh @@ -32,18 +32,17 @@ std::string hexHashStr(const TSrc &src) eng.process_bytes(src.data(), src.size()); // export the hash as an array of unsigned int - typename TEng::digest_type dst; + using TDst = typename TEng::digest_type; + TDst dst; eng.get_digest(dst); // convert the hash to a vector of unsigned int static const size_t len = sizeof(dst) / sizeof(dst[0]); - const std::vector hash(dst, dst + len); + using TElem = typename std::remove_extent::type; + const std::vector hash(dst, dst + len); // convert the hash to a hex string std::string result; - boost::algorithm::hex(hash.begin(), hash.end(), back_inserter(result)); - - // convert uppercase letters to lowercase - boost::algorithm::to_lower(result); + boost::algorithm::hex_lower(hash.begin(), hash.end(), back_inserter(result)); return result; }