Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the use of Google's CityHash other than alternative for hashcode string generation?

Google has released http://code.google.com/p/cityhash/ recently. It is a variant of MurmurHash, http://sites.google.com/site/murmurhash/

As it is mentioned that it can't be used for cryptography, in which all possible interesting cases for using it as an alternative for existing hash?

Looking for algorithms that can use this hash implementation, similar to http://www.partow.net/programming/hashfunctions/

like image 783
zudokod Avatar asked Apr 15 '11 19:04

zudokod


1 Answers

MurmurHash (and by extension, CityHash) are designed as general-purpose, non-secure hashes. The most common use for them is as a key in a hashtable - but other applications, such as Bloom Filters, also exist.

The main criteria for such hashes is that they be fast to generate, yet well distributed, to avoid hotspots in hashtables and the like. The first part rules out slower secure hashing functions, and the second (avoiding hotspots) rules out most trivial functions such as summing or xoring bytes together, which makes the design of a fast but well-distributed hash quite challenging.

like image 151
Nick Johnson Avatar answered Sep 29 '22 10:09

Nick Johnson