comparison Orthanc/Core/Toolbox.cpp @ 60:902dedf9882a

removed unneccessary dependency on md5
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 02 Aug 2015 12:42:18 +0200
parents dbc1c9ca0030
children 78aa0a355d3a fe8dab5c051f
comparison
equal deleted inserted replaced
59:733d1a162baf 60:902dedf9882a
80 #error Since version 0.7.6, Orthanc entirely relies on boost::locale 80 #error Since version 0.7.6, Orthanc entirely relies on boost::locale
81 #endif 81 #endif
82 82
83 #include <boost/locale.hpp> 83 #include <boost/locale.hpp>
84 84
85
86 #if !defined(ORTHANC_ENABLE_MD5) || ORTHANC_ENABLE_MD5 == 1
85 #include "../Resources/ThirdParty/md5/md5.h" 87 #include "../Resources/ThirdParty/md5/md5.h"
88 #endif
89
90
91 #if !defined(ORTHANC_ENABLE_BASE64) || ORTHANC_ENABLE_BASE64 == 1
86 #include "../Resources/ThirdParty/base64/base64.h" 92 #include "../Resources/ThirdParty/base64/base64.h"
93 #endif
87 94
88 95
89 #if defined(_MSC_VER) && (_MSC_VER < 1800) 96 #if defined(_MSC_VER) && (_MSC_VER < 1800)
90 // Patch for the missing "_strtoll" symbol when compiling with Visual Studio < 2013 97 // Patch for the missing "_strtoll" symbol when compiling with Visual Studio < 2013
91 extern "C" 98 extern "C"
438 throw OrthancException(ErrorCode_InexistentFile); 445 throw OrthancException(ErrorCode_InexistentFile);
439 } 446 }
440 } 447 }
441 448
442 449
450 #if !defined(ORTHANC_ENABLE_MD5) || ORTHANC_ENABLE_MD5 == 1
443 static char GetHexadecimalCharacter(uint8_t value) 451 static char GetHexadecimalCharacter(uint8_t value)
444 { 452 {
445 assert(value < 16); 453 assert(value < 16);
446 454
447 if (value < 10) 455 if (value < 10)
487 { 495 {
488 result[2 * i] = GetHexadecimalCharacter(actualHash[i] / 16); 496 result[2 * i] = GetHexadecimalCharacter(actualHash[i] / 16);
489 result[2 * i + 1] = GetHexadecimalCharacter(actualHash[i] % 16); 497 result[2 * i + 1] = GetHexadecimalCharacter(actualHash[i] % 16);
490 } 498 }
491 } 499 }
492 500 #endif
493 501
502
503 #if !defined(ORTHANC_ENABLE_BASE64) || ORTHANC_ENABLE_BASE64 == 1
494 void Toolbox::EncodeBase64(std::string& result, 504 void Toolbox::EncodeBase64(std::string& result,
495 const std::string& data) 505 const std::string& data)
496 { 506 {
497 result = base64_encode(data); 507 result = base64_encode(data);
498 } 508 }
500 void Toolbox::DecodeBase64(std::string& result, 510 void Toolbox::DecodeBase64(std::string& result,
501 const std::string& data) 511 const std::string& data)
502 { 512 {
503 result = base64_decode(data); 513 result = base64_decode(data);
504 } 514 }
515 #endif
516
505 517
506 518
507 #if defined(_WIN32) 519 #if defined(_WIN32)
508 static std::string GetPathToExecutableInternal() 520 static std::string GetPathToExecutableInternal()
509 { 521 {