GNU gperf is a perfect hash function generator.