public static final class CrossHash.Hive
extends java.lang.Object
CrossHash.hash(int[])
, but it has been replaced there by CrossHash.Water
; you should
prefer using the outer class since this inner class is only here for reference. The one advantage Hive has over
Water is potentially better optimization for GWT, but since the main usage of CrossHash is for 64-bit hashes, GWT
will be slow regardless for that usage.
hash(long[])
for long and double), a modification of the main one to perform
better on GWT (only used on hash() overloads, and only when inputs are individually 32-bit or less), and
a simpler algorithm (which was called Jolt) for hash64() on boolean and byte data.
CrossHash.Lightning
or CrossHash.Wisp
, updating them differently from each other, and
bitwise-rotates one at each step. It combines the states (xorshifting one state, multiplying it by a huge
constant, and adding that to the other state) and then runs that through MurmurHash3's finalization function (its
fmix64()
function; the main algorithm elides one xorshift at the end that proved unnecessary). Parts of
the code here are inspired by the design of DiverRNG
, particularly its determine() method since both
use an XLCG (XOR Linear Congruential Generator, as PractRand calls it) as a processing step.
Constructor and Description |
---|
Hive() |
Modifier and Type | Method and Description |
---|---|
static int |
hash(boolean[] data) |
static int |
hash(byte[] data) |
static int |
hash(char[] data) |
static int |
hash(char[][] data) |
static int |
hash(char[] data,
int start,
int end)
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).
|
static int |
hash(char[] data,
int start,
int end,
int step)
Hashes only a subsection of the given data, starting at start (inclusive), ending before end (exclusive), and
moving between chars in increments of step (which is always greater than 0).
|
static int |
hash(java.lang.CharSequence data) |
static int |
hash(java.lang.CharSequence[]... data) |
static int |
hash(java.lang.CharSequence[] data) |
static int |
hash(java.lang.CharSequence data,
int start,
int end)
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).
|
static int |
hash(java.lang.CharSequence data,
int start,
int end,
int step)
Hashes only a subsection of the given data, starting at start (inclusive), ending before end (exclusive), and
moving between chars in increments of step (which is always greater than 0).
|
static int |
hash(double[] data) |
static int |
hash(float[] data) |
static int |
hash(int[] data) |
static int |
hash(int[][] data) |
static int |
hash(java.lang.Iterable<? extends java.lang.CharSequence> data) |
static int |
hash(java.util.List<? extends java.lang.CharSequence> data) |
static int |
hash(long[] data) |
static int |
hash(long[][] data) |
static int |
hash(java.lang.Object data) |
static int |
hash(java.lang.Object[] data) |
static int |
hash(short[] data) |
static long |
hash64(boolean[] data) |
static long |
hash64(byte[] data) |
static long |
hash64(char[] data) |
static long |
hash64(char[][] data) |
static long |
hash64(char[] data,
int start,
int end)
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).
|
static long |
hash64(char[] data,
int start,
int end,
int step)
Hashes only a subsection of the given data, starting at start (inclusive), ending before end (exclusive), and
moving between chars in increments of step (which is always greater than 0).
|
static long |
hash64(java.lang.CharSequence data) |
static long |
hash64(java.lang.CharSequence[]... data) |
static long |
hash64(java.lang.CharSequence[] data) |
static long |
hash64(java.lang.CharSequence data,
int start,
int end)
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).
|
static long |
hash64(java.lang.CharSequence data,
int start,
int end,
int step)
Hashes only a subsection of the given data, starting at start (inclusive), ending before end (exclusive), and
moving between chars in increments of step (which is always greater than 0).
|
static long |
hash64(double[] data) |
static long |
hash64(float[] data) |
static long |
hash64(int[] data) |
static long |
hash64(int[][] data) |
static long |
hash64(java.lang.Iterable<? extends java.lang.CharSequence> data) |
static long |
hash64(java.util.List<? extends java.lang.CharSequence> data) |
static long |
hash64(long[] data) |
static long |
hash64(long[][] data) |
static long |
hash64(java.lang.Object data) |
static long |
hash64(java.lang.Object[] data) |
static long |
hash64(short[] data) |
public static long hash64(java.lang.CharSequence data)
public static long hash64(boolean[] data)
public static long hash64(byte[] data)
public static long hash64(short[] data)
public static long hash64(int[] data)
public static long hash64(long[] data)
public static long hash64(char[] data)
public static long hash64(float[] data)
public static long hash64(double[] data)
public static long hash64(char[] data, int start, int end)
data
- the char array to hashstart
- the start of the section to hash (inclusive)end
- the end of the section to hash (exclusive)public static long hash64(java.lang.CharSequence data, int start, int end)
data
- the String or other CharSequence to hashstart
- the start of the section to hash (inclusive)end
- the end of the section to hash (exclusive)public static long hash64(char[] data, int start, int end, int step)
data
- the char array to hashstart
- the start of the section to hash (inclusive)end
- the end of the section to hash (exclusive)step
- how many elements to advance after using one element from data; must be greater than 0public static long hash64(java.lang.CharSequence data, int start, int end, int step)
data
- the String or other CharSequence to hashstart
- the start of the section to hash (inclusive)end
- the end of the section to hash (exclusive)step
- how many elements to advance after using one element from data; must be greater than 0public static long hash64(char[][] data)
public static long hash64(int[][] data)
public static long hash64(long[][] data)
public static long hash64(java.lang.CharSequence[] data)
public static long hash64(java.lang.CharSequence[]... data)
public static long hash64(java.lang.Iterable<? extends java.lang.CharSequence> data)
public static long hash64(java.util.List<? extends java.lang.CharSequence> data)
public static long hash64(java.lang.Object[] data)
public static long hash64(java.lang.Object data)
public static int hash(java.lang.CharSequence data)
public static int hash(boolean[] data)
public static int hash(byte[] data)
public static int hash(short[] data)
public static int hash(int[] data)
public static int hash(long[] data)
public static int hash(char[] data)
public static int hash(float[] data)
public static int hash(double[] data)
public static int hash(char[] data, int start, int end)
data
- the char array to hashstart
- the start of the section to hash (inclusive)end
- the end of the section to hash (exclusive)public static int hash(java.lang.CharSequence data, int start, int end)
data
- the String or other CharSequence to hashstart
- the start of the section to hash (inclusive)end
- the end of the section to hash (exclusive)public static int hash(char[] data, int start, int end, int step)
data
- the char array to hashstart
- the start of the section to hash (inclusive)end
- the end of the section to hash (exclusive)step
- how many elements to advance after using one element from data; must be greater than 0public static int hash(java.lang.CharSequence data, int start, int end, int step)
data
- the String or other CharSequence to hashstart
- the start of the section to hash (inclusive)end
- the end of the section to hash (exclusive)step
- how many elements to advance after using one element from data; must be greater than 0public static int hash(char[][] data)
public static int hash(int[][] data)
public static int hash(long[][] data)
public static int hash(java.lang.CharSequence[] data)
public static int hash(java.lang.CharSequence[]... data)
public static int hash(java.lang.Iterable<? extends java.lang.CharSequence> data)
public static int hash(java.util.List<? extends java.lang.CharSequence> data)
public static int hash(java.lang.Object[] data)
public static int hash(java.lang.Object data)
Copyright © Eben Howard 2012–2022. All rights reserved.