Skip to content

Commit

Permalink
SERVER-2001 define const to use as default hash seed
Browse files Browse the repository at this point in the history
  • Loading branch information
matulef committed Oct 15, 2012
1 parent 77bf5af commit 02e0dc4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mongo/db/hasher.h
Expand Up @@ -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
Expand Down

0 comments on commit 02e0dc4

Please sign in to comment.