On 26.01.2012 12:15, Bojan Smojver wrote: > ------- Original message ------- >> From: Branko Čibej > >> - hash = ht->hash_func(key, &klen); >> + hash = randomize_hash(ht, ht->hash_func(key, &klen); >> >> Completely private change that leaves hash_func_t unchanged. > > Interesting approach. So, randomize_hash() would then perturb (xor or > something) what the hash function returns based on the seed, right?
Correct. I intentionally left out the implementation, since i don't really have an opinion about how it should be done. I just wanted to point out that there's a simple way to add per-table randomization without changing any of the existing APIs, or adding new ones. -- Brane