Java Hash Calculate hash(int x, int y)

Here you can find the source of hash(int x, int y)

Description

hash

License

Open Source License

Declaration

public static int hash(int x, int y) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int hash(int x, int y) {
        int h = 31;
        h = h * 97 + x;// www  .  ja  va2  s .  c om
        h *= 17;
        h = h * 97 + y;
        h *= 17;
        return h;
    }

    public static int hash(int x, int y, int z) {
        int h = 31;
        h = h * 97 + x;
        h *= 17;
        h = h * 97 + y;
        h *= 17;
        h = h * 97 + z;
        h *= 17;
        return h;
    }

    public static int hash(int x, int y, int z, int w) {
        int h = 31;
        h = h * 97 + x;
        h *= 17;
        h = h * 97 + y;
        h *= 17;
        h = h * 97 + z;
        h *= 17;
        h = h * 97 + w;
        h *= 17;
        return h;
    }

    public static int hash(int x, int y, int z, int w, int u) {
        int h = 31;
        h = h * 97 + x;
        h *= 17;
        h = h * 97 + y;
        h *= 17;
        h = h * 97 + z;
        h *= 17;
        h = h * 97 + w;
        h *= 17;
        h = h * 97 + u;
        h *= 17;
        return h;
    }
}

Related

  1. hash(int seed, int toHash)
  2. hash(int seed, int val)
  3. hash(int state1, int state2, int numStates1)
  4. hash(int val)
  5. hash(int value)
  6. hash(long key)
  7. hash(long mover, long enemy)
  8. hash(Object a, Object b)
  9. hash(Object key, int limit)