From 4fcd42afd3ba92f909b48be72c9392314689ec89 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 14 Jul 2020 21:16:07 +0200 Subject: comphelper: don't hardcode hash sizes in Hash::getLength() Instead move the constants from filter to comphelper and reuse them. Change-Id: Ib7061e9028ccf6067b4e86f50145c1472c2b01d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98785 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- include/comphelper/hash.hxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/comphelper/hash.hxx') diff --git a/include/comphelper/hash.hxx b/include/comphelper/hash.hxx index 52ad5e5cdf1e..54ab3a25105c 100644 --- a/include/comphelper/hash.hxx +++ b/include/comphelper/hash.hxx @@ -11,6 +11,7 @@ #define INCLUDED_COMPHELPER_HASH_HXX #include +#include #include #include @@ -29,6 +30,11 @@ enum class HashType SHA512 }; +const sal_uInt32 MD5_HASH_LENGTH = RTL_DIGEST_LENGTH_MD5; +const sal_uInt32 SHA1_HASH_LENGTH = RTL_DIGEST_LENGTH_SHA1; +const sal_uInt32 SHA256_HASH_LENGTH = 32; +const sal_uInt32 SHA512_HASH_LENGTH = 64; + struct HashImpl; class COMPHELPER_DLLPUBLIC Hash -- cgit