don' use non-data the key fields should be squeezed down until every bit counts for examplethe category codes should be changed to run from to alsothe checksum should be removed because it doesn' add any additional informationit' deliberately redundant various bit-twiddling techniques are appropriate for compressing the various fields in the key use all the data every part of the key (except non-dataas just describedshould contribute to the hash function don' just use the first four digits or some such expurgation the more data that contributes to the keythe more likely it is that the keys will hash evenly into the entire range of indices sometimes the range of keys is so large it overflows type int or type long variables we'll see how to handle overflow when we talk about hashing strings in moment to summarizethe trick is to find hash function that' simple and fastyet excludes the non-data parts of the key and uses all the data use prime number for the modulo base often the hash function involves using the modulo operator (%with the table size we've already seen that it' important for the table size to be prime number when using quadratic probe or double hashing howeverif the keys themselves may not be randomly distributedit' important for the table size to be prime number no matter what hashing system is used this is true becauseif many keys share divisor with the array sizethey may tend to hash to the same locationcausing clustering using prime table size eliminates this possibility for exampleif the table size is multiple of in our car-part examplethe category codes will all hash to index numbers that are multiples of howeverwith prime number such as you are guaranteed that no keys will divide evenly into the table size the moral is to examine your keys carefully and tailor your hash algorithm to remove any irregularity in the distribution of the keys hashing strings we saw at the beginning of this how to convert short strings to key numbers by multiplying digit codes by powers of constant in particularwe saw that the four-letter word cats could turn into number by calculating key * * * *