Best option for perfect hash function

I am looking for best option for having perfect hash function maps which can generate a mapping from K hashable objects to 0..|k|-1 indexes. The number K is determined at runtime, however all the K objects are known at the time of creation of the hashmap.

If you're struggling to get started the key-phrase is "minimal perfect hashing".

Adding "rust" to that search reveals a few crates. I have no experience with them.

I've had good experiences with Bob Jenkins' work.

1 Like

Thanks @Coding-Badly for directing towards exactly what I wanted :smile:

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.