generate perfect hashes