Java Hash Calculate hash(Boolean value)

Here you can find the source of hash(Boolean value)

Description

hash

License

Open Source License

Declaration

public static int hash(Boolean value) 

Method Source Code

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

public class Main {
    public static int hash(Boolean value) {
        return value ? 1231 : 1237;
    }//from  w w w. jav a 2  s  . co  m

    public static int hash(Integer value) {
        return value.intValue();
    }

    public static int hash(Long value) {
        return (int) (value ^ (value >>> 32));
    }

    public static int hash(Float value) {
        return Float.floatToIntBits(value);
    }

    public static int hash(Double value) {
        long bits = Double.doubleToLongBits(value);
        return hash(bits);
    }
}

Related

  1. getHashString()
  2. getHashString(byte[] data)
  3. getHashString(String password, String salt)
  4. getHashWithSalt(String input, String algorithm, String salt)
  5. hash()
  6. hash(boolean value, int seed)
  7. hash(boolean[] array)
  8. hash(byte x)
  9. hash(byte[] bytes)