What are some hash functions with very long period that map to a small integer

Viewed 94

Basically, I am looking for a hash function that works on an N-tuple of 32-bit integers (N would be 4-7) that maps to a number from 0 to M, where M would be in the hundreds or thousands. I don't care if it is predictable, I only need it to have a long period along each dimension (at least 2^32) and not produce the same number two times in a row consecutively along any dimension.

The context of this is that I am doing terrain generation using perlin noise and I don't want my world to be periodic (hashing for an index in an array of gradient vectors).

0 Answers
Related