From 4c34d384e68ce7e2c949a7588d80bbe7d5a96440 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 23 Oct 2012 18:05:50 +0200 Subject: If hashes do not match, print them in base-32 for SHA-1/SHA-256 Fixes #57. --- src/libutil/hash.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libutil/hash.cc') diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index 697a6b475b13..de2c1ebd724f 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -153,6 +153,12 @@ string printHash32(const Hash & hash) } +string printHash16or32(const Hash & hash) +{ + return hash.type == htMD5 ? printHash(hash) : printHash32(hash); +} + + static bool mul(unsigned char * bytes, unsigned char y, int maxSize) { unsigned char carry = 0; -- cgit 1.4.1