Whilst normal hash tables have amortised O(1) lookup, perfect hash tables guarantee O(1)! There's a nifty Rusty lib: https://github.com/sfackler/rust-phf