hash4D method

int hash4D(
  1. int seed,
  2. int x,
  3. int y,
  4. int z,
  5. int w,
)

Implementation

int hash4D(int seed, int x, int y, int z, int w) {
  int hash = seed;
  hash ^= X_PRIME * x;
  hash ^= Y_PRIME * y;
  hash ^= Z_PRIME * z;
  hash ^= W_PRIME * w;
  hash = hash * hash * hash * 60493;
  hash = (hash >> 13) ^ hash;
  return hash;
}