cityhash
« Back to VersTracker
Description:
Hash functions for strings
Type: Formula  |  Latest Version: 1.1.1@0  |  Tracked Since: Dec 17, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: hashing c++ performance library google algorithm
Install: brew install cityhash
About:
CityHash is a collection of non-cryptographic hash functions for strings, optimized for high performance on modern 64-bit and 128-bit architectures. Developed by Google, it provides excellent speed and distribution for hash table lookups and other string processing tasks. It is particularly effective for hashing short to medium-length strings commonly found in server applications.
Key Features:
  • Extremely fast hashing for 64-bit and 128-bit systems
  • Optimized for string keys and common string patterns
  • Provides 128-bit and 256-bit hash variants for collision resistance
  • Header-only C++ implementation for easy integration
Use Cases:
  • High-performance hash table implementations (e.g., hash maps, sets)
  • Distributed systems requiring consistent string partitioning
  • Database indexing and caching mechanisms
  • String deduplication and analysis
Alternatives:
  • xxHash – xxHash is often faster but CityHash may offer better distribution for specific string patterns.
  • MurmurHash – MurmurHash is a widely used general-purpose hash but CityHash is generally faster on 64-bit platforms.
  • SpookyHash – SpookyHash is another fast 128-bit hash, with performance often comparable to CityHash.
License: MIT
Bottles available for: arm64_tahoe, arm64_sequoia, arm64_sonoma, arm64_ventura, arm64_monterey, arm64_big_sur, sonoma, ventura, monterey, big_sur, catalina, arm64_linux, x86_64_linux
Version History
Detected Version Rev Change Commit
Oct 15, 2025 5:02pm 0 VERSION_BUMP 53d4c543
Sep 12, 2025 7:58pm 0 VERSION_BUMP c775f789