diff options
Diffstat (limited to 'src/Common')
-rw-r--r-- | src/Common/Hash.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Common/Hash.h b/src/Common/Hash.h index 06562e2..db581b7 100644 --- a/src/Common/Hash.h +++ b/src/Common/Hash.h @@ -28,6 +28,7 @@ #include <string> #include <vector> +#include <boost/algorithm/string/case_conv.hpp> #include <boost/cstdint.hpp> namespace Mad { @@ -43,7 +44,7 @@ class MAD_COMMON_EXPORT Hash { std::vector<std::string> list; void addHash(const std::string &name, unsigned id) { - map.insert(std::make_pair(name, id)); + map.insert(std::make_pair(boost::algorithm::to_lower_copy(name), id)); list.push_back(name); } @@ -67,13 +68,13 @@ class MAD_COMMON_EXPORT Hash { } static bool isHashSupported(const std::string &method) { - return (hashes.getMap().find(method) != hashes.getMap().end()); + return (hashes.getMap().find(boost::algorithm::to_lower_copy(method)) != hashes.getMap().end()); } static std::vector<boost::uint8_t> hash(const std::vector<boost::uint8_t> &in, unsigned int method) throw (Core::Exception); static std::vector<boost::uint8_t> hash(const std::vector<boost::uint8_t> &in, const std::string &method) throw (Core::Exception) { - std::map<std::string, unsigned int>::const_iterator methodIt = hashes.getMap().find(method); + std::map<std::string, unsigned int>::const_iterator methodIt = hashes.getMap().find(boost::algorithm::to_lower_copy(method)); if(methodIt == hashes.getMap().end()) throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED)); |