CityHash is a family of non-cryptographic hash functions optimized for extremely fast and high-quality hashing of strings on modern CPUs. Developed by Google, it is implemented in C++ and designed to efficiently handle both short and long inputs using techniques such as mixing operations and CPU-specific optimizations. CityHash offers multiple hash sizes—32-bit, 64-bit, 128-bit, and 256-bit variants—with the CRC-based versions leveraging hardware acceleration on CPUs that support SSE4.2 CRC32 instructions. The library emphasizes hashing performance and uniformity rather than cryptographic security, making it ideal for use in data structures like hash tables and distributed systems requiring rapid key lookups. CityHash has been rigorously tested using tools like SMHasher to ensure high-quality mixing and collision resistance across a wide range of inputs. Its speed and portability have made it a popular choice for developers needing dependable, lightweight hash functions.

Features

  • High-performance non-cryptographic hash functions for strings and binary data
  • Supports 32-bit, 64-bit, 128-bit, and 256-bit output variants
  • Optimized for little-endian 64-bit CPUs, with CRC32 acceleration on supported hardware
  • Thoroughly tested for hash quality and collision resistance using SMHasher
  • Portable C++ implementation compatible with various compilers and platforms
  • Ideal for hash tables, caching systems, and general-purpose string hashing

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow CityHash

CityHash Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of CityHash!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

C++, Unix Shell

Related Categories

Unix Shell Libraries, C++ Libraries

Registered

2025-10-11