Android Hash Code Calculate hash(int seed, Object o)

Here you can find the source of hash(int seed, Object o)

Description

hash

Declaration

public static int hash(int seed, Object o) 

Method Source Code

//package com.java2s;

public class Main {
    private static final int PRIME = 102653;

    public static int hash(int seed, int x) {
        return firstTerm(seed) + x;
    }/*from w w  w . j  a v  a2 s.  co m*/

    public static int hash(int seed, boolean x) {
        return firstTerm(seed) + (x ? 0 : 1);
    }

    public static int hash(int seed, Object o) {
        return firstTerm(seed) + (o == null ? 0 : o.hashCode());
    }

    private static int firstTerm(int seed) {
        return seed * PRIME;
    }
}

Related

  1. hash(File file, String algorithm)
  2. hash(String input, String algorithm)
  3. hash(String password)
  4. hash(String s, String algorithm)
  5. hash(char[] pin, byte[] salt)
  6. hash(int seed, boolean x)
  7. hash(int seed, int x)
  8. hash2jsonBytes(Map hash)
  9. hashBitmap(Bitmap bitmap)