Understand Minimal Perfect Hash Functions (MPHF) in boomphf
masterThe boomphf library implements minimal perfect hash functions for massive key sets.
Key Characteristics:
- Efficiency: Generates hash functions that consume approximately 3-6 bits per item.
- Construction Memory: Memory usage during construction is typically less than 2x the size of the dataset plus the final MPHF size.
- Constraint: MPHFs only return valid, predictable hash values for objects that were part of the original set used to create the function. Hashing an object not in the original set will return an arbitrary hash value. If you need to distinguish between set members and non-members, you must implement an auxiliary detection scheme.
- Internal Implementation: The crate includes its own bit-vector implementation to support rank-select queries and multi-threaded read-write access.