Android Hash Code Calculate hash(int seed, boolean x)

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

Description

hash

Declaration

public static int hash(int seed, boolean x) 

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  ww  .  j a va2s. c  om

    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(String input, String algorithm)
  2. hash(String password)
  3. hash(String s, String algorithm)
  4. hash(char[] pin, byte[] salt)
  5. hash(int seed, Object o)
  6. hash(int seed, int x)
  7. hash2jsonBytes(Map hash)
  8. hashBitmap(Bitmap bitmap)
  9. hashBitmap(Bitmap bitmap)