Live data from Hacker News

Which hashing algorithm is best for uniqueness and speed?

programmers.stackexchange.com

1–10 of 110 posts

Re: Which hashing algorithm is best for uniqueness and speed?

#3
MurmurHash2, which is pretty great, has some issues:

"MurmurHash2_x86_64 computes two 32-bit results in parallel and mixes them at the end, which is fast but means that collision resistance is only as good as a 32-bit hash. I suggest avoiding this variant."[1]

Murmurhash3 has a 128-bit variant, which might be more along the lines of what he's looking for (the original post mentions SHA256).

1: http://code.google.com/p/smhasher/wiki/MurmurHash3

Re: Which hashing algorithm is best for uniqueness and speed?

#6
post #2

isn't slow better in this case? I mean if it's fast to generate, it's fast to crack, right?

Not if you're not looking for it to be hard to crack. Suppose you're generating quick checksums, using a hashtable, indexing non-malicious data, etc. In those cases you want a very fast hash function, and you're not worried about folks being able to find collisions for existing hashes, or create multiple values with the same hash.

Re: Which hashing algorithm is best for uniqueness and speed?

#7
post #2

isn't slow better in this case? I mean if it's fast to generate, it's fast to crack, right?

Given Moore's law and the prevalence of botnets and cloud computing - hash speed really isn't a very strong means of defence against cracking...

Also see: http://cyberarms.wordpress.com/2010/10/21/cracking-14-charac...

Re: Which hashing algorithm is best for uniqueness and speed?

#8
post #4
post #2

isn't slow better in this case? I mean if it's fast to generate, it's fast to crack, right?

The person specifically requested an algorithm for a hash table. Nobody is going to attempt to crack that

nobody? This exact problem was a massive issue within the year.

https://www.securityweek.com/hash-table-collision-attacks-co...

Re: Which hashing algorithm is best for uniqueness and speed?

#9
post #2

isn't slow better in this case? I mean if it's fast to generate, it's fast to crack, right?

> isn't slow better in this case?

No, guy's looking for a hash table hash, not a cryptographic one. For a hash table you're looking for low collisions and high throughput (so your hash table is fast) first and foremost.

Re: Which hashing algorithm is best for uniqueness and speed?

#10
post #4

Earlier quoted context omitted.

The person specifically requested an algorithm for a hash table. Nobody is going to attempt to crack that

nobody? This exact problem was a massive issue within the year. https://www.securityweek.com/hash-table-collision-attacks-co...

Using a slower hash would make the issue worse (linearly): the collisions would still be there, but now each insertion would take even more time due to the extra computational cost of the hash.
Post reply on HN