Here you can find the source of murmurHash3(int x)
public static int murmurHash3(int x)
//package com.java2s; /*/*from w w w . j a v a2 s . c om*/ * Copyright (c) 2017 VMware Inc. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 * * 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. */ public class Main { public static int murmurHash3(int x) { x ^= x >>> 16; x *= -2048144789; x ^= x >>> 13; x *= -1028477387; x ^= x >>> 16; return x; } private static long murmurHash3(long x) { x ^= x >>> 33; x *= -49064778989728563L; x ^= x >>> 33; x *= -4265267296055464877L; x ^= x >>> 33; return x; } public static long murmurHash3(long seed, long data) { long h1 = murmurHash3(data); h1 = h1 ^ seed; return murmurHash3(h1); } public static int murmurHash3(int seed, int data) { int h1 = murmurHash3(data); h1 = h1 ^ seed; return murmurHash3(h1); } }