Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is MurmurHash3 seed parameter?

Tags:

c++

hash

MurmurHash3_x86_32() expects a seed parameter. What value should I use and what does it do?

like image 697
Tiago Costa Avatar asked Feb 11 '12 15:02

Tiago Costa


People also ask

Is Python hash consistent?

As noted by many, Python's hash is not consistent anymore (as of version 3.3), as a random PYTHONHASHSEED is now used by default (to address security concerns, as explained in this excellent answer).

Is murmur hash deterministic?

MurmurHash function does not behave deterministic.

What is a hash function seed?

A Seed is a random value that selects the specific hash function computed by a Hash. If two Hashes use the same Seeds, they will compute the same hash values for any given input. If two Hashes use different Seeds, they are very likely to compute distinct hash values for any given input.


1 Answers

The seed parameter is a means for you to randomize the hash function. You should provide the same seed value for all calls to the hashing function in the same application of the hashing function. However, each invocation of your application (assuming it is creating a new hash table) can use a different seed, e.g., a random value.

Why is it provided?

One reason is that attackers may use the properties of a hash function to construct a denial of service attack. They could do this by providing strings to your hash function that all hash to the same value destroying the performance of your hash table. But if you use a different seed for each run of your program, the set of strings the attackers must use changes.

See: Effective DoS on web application platform

There's also a Twitter tag for #hashDoS

like image 98
Doug Currie Avatar answered Oct 02 '22 10:10

Doug Currie