CityHash Family of Hash Functions Launches with 'CityHash64 and CityHash128' Functions by Google

Google CityHash family of hash functions for strings today released with two functions today: CityHash64 and CityHash128. "They hash strings to 64- and 128-bit hash codes, respectively. These functions aren't suitable for cryptography, but our experience so far shows that they're great for, say, hash tables," Google stated."CityHash provides hash functions for strings. The functions […]

Google CityHash family of hash functions for strings today released with two functions today: CityHash64 and CityHash128. "They hash strings to 64- and 128-bit hash codes, respectively. These functions aren't suitable for cryptography, but our experience so far shows that they're great for, say, hash tables," Google stated.

"CityHash provides hash functions for strings. The functions mix the input bits thoroughly but aren't suitable for cryptography. We provide reference implementations in C++, with a friendly MIT license: city.cc, city.h.

CityHash64() and similar return a 64-bit hash. Inside Google, where CityHash was developed starting in 2010, we use variants of CityHash64() mainly in hash tables such as hash_map<string, int>.

CityHash128() and similar return a 128-bit hash and are tuned for strings of at least a few hundred bytes. Depending on your compiler and hardware, it may be faster than CityHash64() on sufficiently long strings. It's known to be slower than necessary on shorter strings, but we expect that case to be relatively unimportant. Inside Google we use variants of CityHash128() mainly for code that wants to minimize collisions."

"We're pleased to announce the new CityHash family of hash functions for strings. We're releasing two functions today: CityHash64 and CityHash128. They hash strings to 64- and 128-bit hash codes, respectively. These functions aren't suitable for cryptography, but our experience so far shows that they're great for, say, hash tables."

More Info: CityHash

[Source: Open Source at Goole blog]