]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Hash.hh
better logging (maybe) and exception handling
[chaz/yoink] / src / Moof / Hash.hh
index c0695447ab303f6438b264fc4b2e9141fb0ad661..f0fab50705aca13e9c554d5eb14c0c161a36699e 100644 (file)
 namespace Mf {
 
 
 namespace Mf {
 
 
-unsigned MurmurHash2_(const void* key, int len, unsigned seed);
-
-struct hash_string
+struct getHash
 {
 {
+       // generic hash function
+       unsigned operator()(const void* key, int len, unsigned seed = -1) const;
+
        inline unsigned operator()(const std::string& val) const
        {
        inline unsigned operator()(const std::string& val) const
        {
-               return MurmurHash2_(val.data(), val.length(), -1);
+               return (*this)(val.data(), val.length());
+       }
+
+       inline unsigned operator()(int val) const
+       {
+               return val;
        }
 };
 
        }
 };
 
This page took 0.018172 seconds and 4 git commands to generate.