/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Hashing utilities.
*
* Little endian implementations of Murmur3 hashing.
*/
public class Hashing {
/**
* Static utility methods only.
*/
private Hashing() {
throw new Error("No instances");
}
}
}
@SuppressWarnings("fallthrough")
// body
while (count >= 4) {
count -= 4;
offset += 4;
k1 *= 0xcc9e2d51;
k1 *= 0x1b873593;
}
// tail
if (count > 0) {
int k1 = 0;
switch (count) {
case 3:
// fall through
case 2:
// fall through
case 1:
// fall through
default:
k1 *= 0xcc9e2d51;
k1 *= 0x1b873593;
}
}
// finalization
// finalization mix force all bits of a hash block to avalanche
h1 *= 0x85ebca6b;
h1 *= 0xc2b2ae35;
return h1;
}
}
}
// body
while (count >= 2) {
count -= 2;
k1 *= 0xcc9e2d51;
k1 *= 0x1b873593;
}
// tail
if (count > 0) {
k1 *= 0xcc9e2d51;
k1 *= 0x1b873593;
}
// finalization
// finalization mix force all bits of a hash block to avalanche
h1 *= 0x85ebca6b;
h1 *= 0xc2b2ae35;
return h1;
}
}
}
// body
k1 *= 0xcc9e2d51;
k1 *= 0x1b873593;
}
// tail (always empty, as body is always 32-bit chunks)
// finalization
// finalization mix force all bits of a hash block to avalanche
h1 *= 0x85ebca6b;
h1 *= 0xc2b2ae35;
return h1;
}
/**
* Holds references to things that can't be initialized until after VM
* is fully booted.
*/
private static class Holder {
/**
* Access to {@code String.hash32()}
*/
static {
if (null == LANG_ACCESS) {
throw new Error("Shared secrets not initialized");
}
}
}
/**
* Return a 32 bit hash value for the specified string. The algorithm is
* unspecified but will be consistent within a VM instance.
*
* @param string String to be hashed.
* @return hash value of the string.
*/
}
/**
* Return a non-zero 32-bit pseudo random value. The {@code instance} object
* may be used as part of the value.
*
* @param instance an object to use if desired in choosing value.
* @return a non-zero 32-bit pseudo random value.
*/
int seed;
} else {
// lower quality "random" seed value--still better than zero and not
// not practically reversible.
int hashing_seed[] = {
};
}
// force to non-zero.
}
}