hash2D function

int hash2D(
  1. int seed,
  2. int x,
  3. int y
)

Implementation

@pragma('vm:prefer-inline')
int hash2D(int seed, int x, int y) {
  IntX hash = Int32(seed);
  hash ^= _xPrime * x;
  hash ^= _yPrime * y;

  hash = hash * hash * hash * 60493;
  hash = (hash >> 13) ^ hash;

  return hash.toInt();
}