summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin Matulef <matulef@gmail.com>2012-10-14 23:51:00 -0400
committerKevin Matulef <matulef@gmail.com>2012-10-14 23:51:00 -0400
commit02e0dc4015276b787dcfc448304d978a06bec51d (patch)
tree4319f426a7426a7de93502d252f314230c7f63df /src
parent77bf5afd2483098c11b0286d7882d15b9351fbee (diff)
downloadmongo-02e0dc4015276b787dcfc448304d978a06bec51d.tar.gz
SERVER-2001 define const to use as default hash seed
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/hasher.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/hasher.h b/src/mongo/db/hasher.h
index f252b058faa..ae3e9567cee 100644
--- a/src/mongo/db/hasher.h
+++ b/src/mongo/db/hasher.h
@@ -64,6 +64,13 @@ namespace mongo {
class BSONElementHasher : private boost::noncopyable {
public:
+
+ /* The hash function we use can be given a seed, to effectively randomize it
+ * by choosing from among a family of hash functions. When it is not specified,
+ * use this.
+ */
+ static const int DEFAULT_HASH_SEED = 0;
+
/* This computes a 64-bit hash of the value part of BSONElement "e",
* preceded by the seed "seed". Squashes element (and any sub-elements)
* of the same canonical type, so hash({a:{b:4}}) will be the same