summaryrefslogtreecommitdiff
path: root/src/mongo/db/hasher.h
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2016-07-13 09:58:12 -0400
committerAndy Schwerin <schwerin@mongodb.com>2016-08-14 16:27:37 -0400
commita20072827032fc57506af6bbb232bd2d0fc9d4e2 (patch)
tree7ceb991e8a8582f00435728983f06fcf38bbd384 /src/mongo/db/hasher.h
parentbd66e1bdbc627979e7bb6824fbdfc132093a9bf9 (diff)
downloadmongo-a20072827032fc57506af6bbb232bd2d0fc9d4e2.tar.gz
SERVER-25573 Shrink hasher.h header file.
Diffstat (limited to 'src/mongo/db/hasher.h')
-rw-r--r--src/mongo/db/hasher.h46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/mongo/db/hasher.h b/src/mongo/db/hasher.h
index 15fd27d2696..6ecb1bc68b5 100644
--- a/src/mongo/db/hasher.h
+++ b/src/mongo/db/hasher.h
@@ -36,46 +36,10 @@
#include "mongo/base/disallow_copying.h"
#include "mongo/bson/bsonelement.h"
-#include "mongo/util/md5.hpp"
namespace mongo {
typedef int HashSeed;
-typedef unsigned char HashDigest[16];
-
-class Hasher {
- MONGO_DISALLOW_COPYING(Hasher);
-
-public:
- explicit Hasher(HashSeed seed);
- ~Hasher(){};
-
- // pointer to next part of input key, length in bytes to read
- void addData(const void* keyData, size_t numBytes);
-
- // finish computing the hash, put the result in the digest
- // only call this once per Hasher
- void finish(HashDigest out);
-
-private:
- md5_state_t _md5State;
- HashSeed _seed;
-};
-
-class HasherFactory {
- MONGO_DISALLOW_COPYING(HasherFactory);
-
-public:
- /* Eventually this may be a more sophisticated factory
- * for creating other hashers, but for now use MD5.
- */
- static Hasher* createHasher(HashSeed seed) {
- return new Hasher(seed);
- }
-
-private:
- HasherFactory();
-};
class BSONElementHasher {
MONGO_DISALLOW_COPYING(BSONElementHasher);
@@ -104,16 +68,6 @@ public:
*/
static long long int hash64(const BSONElement& e, HashSeed seed);
- /* This incrementally computes the hash of BSONElement "e"
- * using hash function "h". If "includeFieldName" is true,
- * then the name of the field is hashed in between the type of
- * the element and the element value. The hash function "h"
- * is applied recursively to any sub-elements (arrays/sub-documents),
- * squashing elements of the same canonical type.
- * Used as a helper for hash64 above.
- */
- static void recursiveHash(Hasher* h, const BSONElement& e, bool includeFieldName);
-
private:
BSONElementHasher();
};