boostorg / boostorg/openmethod

implement a minimal perfect hashing policy

Open
#56 0 comments 1 reaction 1 assignee Assigned to @Copilot View on GitHub
enhancement
Dominant language
C++
Stars
13
Forks
6
Avg merge
1d 23h
Merged PRs (30d)
15

Description

Implement a new `type_hash` policy, `minimal_perfect_hash`, that is modeled after the existing `fast_perfect_hash` policy, except that it finds a perfect minimal hash function using the PtHash algorithm. The primary hash function is in the form `H(x) = (M * x) >> N`, where `x` is the value to hash (a `type_id`), and M and N are the integer parameters of the hash function. Like with `fast_perfect_hash`, if the `runtime_checks` policy is present in the registry, create a control table during initialization, and use it during hashing to check that the input value `x` is in the universe passed to `initialize`. Also create a test suite.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.