Java Hash Code Calculate hashCode(final long v)

Here you can find the source of hashCode(final long v)

Description

Return a hashcode for a long.

License

Open Source License

Parameter

Parameter Description
v value

Return

hash

Declaration

public static int hashCode(final long v) 

Method Source Code

//package com.java2s;
/*/*from   w  w w . j  a va  2 s .c om*/
 * Copyright (c) 2014. Real Time Genomics Limited.
 *
 * Use of this source code is bound by the Real Time Genomics Limited Software Licence Agreement
 * for Academic Non-commercial Research Purposes only.
 *
 * If you did not receive a license accompanying this file, a copy must first be obtained by email
 * from support@realtimegenomics.com.  On downloading, using and/or continuing to use this source
 * code you accept the terms of that license agreement and any amendments to those terms that may
 * be made from time to time by Real Time Genomics Limited.
 */

public class Main {
    /**
     * Return a hashcode for a long.
     * @param v value
     * @return hash
     */
    public static int hashCode(final long v) {
        return (int) (v ^ (v >>> 32));
    }
}

Related

  1. hashCode(final int seed, final int hashcode)
  2. hashCode(final int x, final int y)
  3. hashcode(final int[] array)
  4. hashCode(final long l)
  5. hashCode(final long l)
  6. hashCode(final Object obj)
  7. hashCode(final Object obj)
  8. hashCode(final Object object)
  9. hashCode(final Object... array)