If you're gonna use a really huge number of buckets in the millions or more, then there are algorithms you can use for primarily testing which will help you find a prime in about the range that you're looking for. &amp;gt;&amp;gt; So that's the first order rule of thumb you should remember if you're using the modulus compression function, which is set the number of buckets equal to a prime. 