Here you can find the source of hashIntArray(int seed, int[] data, int offset, int len)
public static int hashIntArray(int seed, int[] data, int offset, int len)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 BowenCai.//from ww w .j av a 2 s . c o m * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html * * Contributors: * BowenCai - initial API and implementation ******************************************************************************/ public class Main { public static int hashIntArray(int seed, int[] data, int offset, int len) { int h1 = seed; int off = offset; int end = offset + len; // body while (off < end) { int k1 = data[off++]; k1 *= 0xcc9e2d51; k1 = Integer.rotateLeft(k1, 15); k1 *= 0x1b873593; h1 ^= k1; h1 = Integer.rotateLeft(h1, 13); h1 = h1 * 5 + 0xe6546b64; } // tail (always empty, as body is always 32-bit chunks) // finalization h1 ^= len * (Integer.SIZE / Byte.SIZE); // finalization mix force all bits of a hash block to avalanche h1 ^= h1 >>> 16; h1 *= 0x85ebca6b; h1 ^= h1 >>> 13; h1 *= 0xc2b2ae35; h1 ^= h1 >>> 16; return h1; } }