libcmph
« Back to VersTracker
Description:
C minimal perfect hashing library
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: hashing c-library algorithm perfect-hash performance
Install: brew install libcmph
About:
Libcmph is a C library designed for creating and querying minimal perfect hash functions. It efficiently maps a static set of keys to a contiguous range of integers with no collisions, using minimal space. This makes it ideal for memory-constrained applications requiring fast key lookups.
Key Features:
  • Supports multiple hashing algorithms (BDZ, CHM, FCH, etc.)
  • C library with bindings for Python, Java, and PHP
  • Command-line utility for generating hash files
  • Low memory footprint during construction and querying
Use Cases:
  • Indexing large dictionaries for memory-efficient lookups
  • Compiler symbol table generation
  • Network packet classification
Alternatives:
  • gperf – GNU gperf generates perfect hash functions but is often less memory-efficient for large datasets than Libcmph.
  • Sux4J – A Java library offering similar functionality, but Libcmph provides a native C implementation.
Version History
Detected Version Rev Change Commit
Sep 13, 2025 10:48am 0 VERSION_BUMP 8b3484dd