Hash Lab

Non-cryptographic

CityHash & FarmHash

Two generations of Google’s fast string-hash families. CityHash(Geoff Pike & Jyrki Alakuijala, 2011) was designed as a faster, better-distributed Murmur with platform-specific paths. FarmHash (2014) refined the architecture, exposed cleaner APIs (Hash64, Hash128), and added CPU-feature-dispatch wrappers.

At a glance

Output32, 64, 128, or 256 bits depending on call
Throughput~7–15 GiB/s on modern CPUs
Year2011 (CityHash), 2014 (FarmHash)
StandardNone; reference impl on GitHub (google/cityhash, google/farmhash)
StatusNon-cryptographic; superseded for raw speed by xxHash3

Where they are used

Differences vs MurmurHash

And vs xxHash3?

xxHash3 (2019) is faster on most modern CPUs and has cleaner SIMD scalability. CityHash / FarmHash remain in production for legacy reasons and for inter-product reproducibility with Google’s ecosystem.

References

Test Your Knowledge

Quick MCQ check on this algorithm

Start Quiz →

AI Summary

Summarize this page in your favorite LLM