diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-07-14 21:16:07 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-07-15 09:16:05 +0200 |
commit | 4fcd42afd3ba92f909b48be72c9392314689ec89 (patch) | |
tree | d5d21339948547909bd3f1afb81249d89fc28921 /include/comphelper/hash.hxx | |
parent | 96ada688eaf7454791a5d8f8e0abe68e2c417e26 (diff) |
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 <vmiklos@collabora.com>
Diffstat (limited to 'include/comphelper/hash.hxx')
-rw-r--r-- | include/comphelper/hash.hxx | 6 |
1 files changed, 6 insertions, 0 deletions
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 <comphelper/comphelperdllapi.h> +#include <rtl/digest.h> #include <memory> #include <vector> @@ -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 |