Rewrote the hash table generation time algorithm.

It should now take O(lg length) time, assuming Math.pow is indeed O(lg
exponent) time as well.