Java Integer Hash intHash(final long a)

Here you can find the source of intHash(final long a)

Description

If the specified value is in int range, the returned value is identical.

License

Open Source License

Return

An int hash of the specified value.

Declaration

public static int intHash(final long a) 

Method Source Code

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

public class Main {
    /**//from  w  ww  .j  av  a  2s.com
     * If the specified value is in int range, the returned value is identical.
     *
     * @return An int hash of the specified value.
     */
    public static int intHash(final long a) {
        int hash = (int) (a >> 32) + (int) a;
        if (a < 0) {
            hash++;
        }
        return hash;
    }
}

Related

  1. intHash(int i)
  2. intHash(int input)
  3. intHash(int key)
  4. intHash(int number, int max)