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

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
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