diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-10-23 18:05:50 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-10-23 18:05:50 +0200 |
commit | 4c34d384e68ce7e2c949a7588d80bbe7d5a96440 (patch) | |
tree | 7a60f33812b8009e105bd43ce7cc1f19dec413b2 /src/libutil/hash.cc | |
parent | a28b4445a4eb8108dfc028083d3939d5f3a42685 (diff) |
If hashes do not match, print them in base-32 for SHA-1/SHA-256
Fixes #57.
Diffstat (limited to 'src/libutil/hash.cc')
-rw-r--r-- | src/libutil/hash.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index 697a6b475..de2c1ebd7 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; |