Mercurial > code
changeset 579:8523c9300c4c
Hash: reduce column limit
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 20 Jul 2016 16:28:52 +0200 |
parents | 67da1bacd884 |
children | 6082ef1fa880 |
files | modules/hash/hash.hpp |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/modules/hash/hash.hpp Wed Jul 20 16:26:55 2016 +0200 +++ b/modules/hash/hash.hpp Wed Jul 20 16:28:52 2016 +0200 @@ -62,7 +62,11 @@ using Final = int (*)(unsigned char *, Context *); template <typename Context, size_t Length, typename InputIt> -inline std::string convert(InputIt it, InputIt end, Init<Context> init, Update<Context> update, Final<Context> finalize) +inline std::string convert(InputIt it, + InputIt end, + Init<Context> init, + Update<Context> update, + Final<Context> finalize) { unsigned char digest[Length] = { 0 }; char hash[Length * 2 + 1]; @@ -83,7 +87,7 @@ finalize(digest, &ctx); for (unsigned long i = 0; i < Length; i++) - std::snprintf(&hash[i * 2], 2 + 1, "%02x", (unsigned int)digest[i]); + std::snprintf(&hash[i * 2], 2 + 1, "%02x", static_cast<unsigned>(digest[i])); return std::string(hash); }