# HG changeset patch # User Sebastien Jodogne # Date 1438510827 -7200 # Node ID 8f28a1cd23545d005cb19a905825097b7a7f4a57 # Parent 1011bd6ab00b807735ecee6dddaa5edb6ff27306 possibility to disable md5 and base64 support in the toolbox diff -r 1011bd6ab00b -r 8f28a1cd2354 Core/Toolbox.cpp --- a/Core/Toolbox.cpp Sat Aug 01 21:49:20 2015 +0200 +++ b/Core/Toolbox.cpp Sun Aug 02 12:20:27 2015 +0200 @@ -82,8 +82,15 @@ #include + +#if !defined(ORTHANC_ENABLE_MD5) || ORTHANC_ENABLE_MD5 == 1 #include "../Resources/ThirdParty/md5/md5.h" +#endif + + +#if !defined(ORTHANC_ENABLE_BASE64) || ORTHANC_ENABLE_BASE64 == 1 #include "../Resources/ThirdParty/base64/base64.h" +#endif #if defined(_MSC_VER) && (_MSC_VER < 1800) @@ -451,6 +458,7 @@ } +#if !defined(ORTHANC_ENABLE_MD5) || ORTHANC_ENABLE_MD5 == 1 void Toolbox::ComputeMD5(std::string& result, const std::string& data) { @@ -489,8 +497,10 @@ result[2 * i + 1] = GetHexadecimalCharacter(actualHash[i] % 16); } } +#endif +#if !defined(ORTHANC_ENABLE_BASE64) || ORTHANC_ENABLE_BASE64 == 1 void Toolbox::EncodeBase64(std::string& result, const std::string& data) { @@ -502,6 +512,8 @@ { result = base64_decode(data); } +#endif + #if defined(_WIN32) diff -r 1011bd6ab00b -r 8f28a1cd2354 Core/Toolbox.h --- a/Core/Toolbox.h Sat Aug 01 21:49:20 2015 +0200 +++ b/Core/Toolbox.h Sun Aug 02 12:20:27 2015 +0200 @@ -90,12 +90,14 @@ uint64_t GetFileSize(const std::string& path); +#if !defined(ORTHANC_ENABLE_MD5) || ORTHANC_ENABLE_MD5 == 1 void ComputeMD5(std::string& result, const std::string& data); void ComputeMD5(std::string& result, const void* data, size_t length); +#endif void ComputeSHA1(std::string& result, const std::string& data); @@ -105,11 +107,13 @@ bool IsSHA1(const std::string& s); +#if !defined(ORTHANC_ENABLE_BASE64) || ORTHANC_ENABLE_BASE64 == 1 void DecodeBase64(std::string& result, const std::string& data); void EncodeBase64(std::string& result, const std::string& data); +#endif std::string GetPathToExecutable();