Here you can find the source of hashCode(final long l)
public static int hashCode(final long l)
//package com.java2s; /*/* w ww.j a va 2 s .c o m*/ * @(#)$Id$$ * * Copyright 2006-2008 Makoto YUI * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Contributors: * Makoto YUI - initial implementation */ public class Main { public static int hashCode(final long l) { return (int) (l ^ (l >>> 32)); } public static int hashCode(final char[] ch, final int offset, final int length) { if (ch == null) { return 0; } int result = 1; final int limit = offset + length; for (int i = offset; i < limit; i++) { result = 31 * result + ch[i]; } return result; } public static int hashCode(final byte[] b) { return hashCode(b, 0, b.length); } public static int hashCode(final byte[] b, final int offset, final int length) { if (b == null) { return 0; } int result = 1; final int limit = offset + length; for (int i = offset; i < limit; i++) { result = 31 * result + b[i]; } return result; } }