3 ms·
> You either should write proper hash code, or you should not use data structures which use hash code. There's also the question of which hash code. Do you use
by cesarb 3y ago
> You either should write proper hash code, or you should not use data structures which use hash code.
There's also the question of which hash code. Do you use a fast but low quality hash function, or a slower but higher quality one? Does your hash function need to be secure against hash collision attacks? Does it have to be deterministic? The correct choice of hash function can depend on the data structure, and the same object might have to be hashed with different hash functions (or different hash function seeds) in the same program.