Package squidpony.squidmath
Class CrossHash.Yolk
java.lang.Object
squidpony.squidmath.CrossHash.Yolk
- Enclosing class:
- CrossHash
public static final class CrossHash.Yolk extends Object
Like Mist, this is a class for hash functors, each an object with a 64-bit long seed, but it uses about the same
algorithm as
CrossHash.Water
instead of the older, less-robust style Mist uses. This can be faster than
CrossHash.Curlup
, but only for small arrays as input (20 length or less); it tends to be slower on larger arrays,
though not by much, and should be the same for long[]
since they share an implementation for that type.
Normally you should prefer Curlup if you know some or all of your arrays will be of moderate size or larger.
Has a lot of predefined functors (192, named after 24 Greek letters and 72 Goetic demons, see
Wikipedia for the demons,
in both lower case and lower case with a trailing underscore). You probably want to use predefined
instead of wrangling demon names; you can always choose an element from predefined with a 7-bit number, and there
are 64 numbers outside that range so you can choose any of those when a functor must be different.-
Field Summary
-
Constructor Summary
Constructors Constructor Description Yolk()
Yolk(long seed)
Yolk(CharSequence seed)
-
Method Summary
Modifier and Type Method Description int
hash(boolean[] data)
int
hash(byte[] data)
int
hash(char[] data)
int
hash(char[][] data)
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).int
hash(double[] data)
int
hash(float[] data)
int
hash(int[] data)
int
hash(int[][] data)
int
hash(int[] data, int length)
int
hash(long[] data)
int
hash(long[][] data)
static int
hash(long seed, boolean[] data)
static int
hash(long seed, byte[] data)
static int
hash(long seed, char[] data)
static int
hash(long seed, char[][] data)
static int
hash(long seed, 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(long seed, double[] data)
static int
hash(long seed, float[] data)
static int
hash(long seed, int[] data)
static int
hash(long seed, int[][] data)
static int
hash(long seed, int[] data, int length)
static int
hash(long seed, long[] data)
static int
hash(long seed, long[][] data)
static int
hash(long seed, short[] data)
static int
hash(long seed, CharSequence data)
static int
hash(long seed, CharSequence[] data)
static int
hash(long seed, CharSequence[]... data)
static int
hash(long seed, 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(long seed, Iterable<? extends CharSequence> data)
static int
hash(long seed, Object data)
static int
hash(long seed, Object[] data)
static int
hash(long seed, List<? extends CharSequence> data)
int
hash(short[] data)
int
hash(CharSequence data)
int
hash(CharSequence[] data)
int
hash(CharSequence[]... data)
int
hash(CharSequence data, int start, int end)
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).int
hash(Iterable<? extends CharSequence> data)
int
hash(Object data)
int
hash(Object[] data)
int
hash(List<? extends CharSequence> data)
long
hash64(boolean[] data)
long
hash64(byte[] data)
long
hash64(char[] data)
long
hash64(char[][] data)
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).long
hash64(double[] data)
long
hash64(float[] data)
long
hash64(int[] data)
long
hash64(int[][] data)
long
hash64(int[] data, int length)
long
hash64(long[] data)
long
hash64(long[][] data)
static long
hash64(long seed, boolean[] data)
static long
hash64(long seed, byte[] data)
static long
hash64(long seed, char[] data)
static long
hash64(long seed, char[][] data)
static long
hash64(long seed, 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(long seed, double[] data)
static long
hash64(long seed, float[] data)
static long
hash64(long seed, int[] data)
static long
hash64(long seed, int[][] data)
static long
hash64(long seed, int[] data, int length)
static long
hash64(long seed, long[] data)
static long
hash64(long seed, long[][] data)
static long
hash64(long seed, short[] data)
static long
hash64(long seed, CharSequence data)
static long
hash64(long seed, CharSequence[] data)
static long
hash64(long seed, CharSequence[]... data)
static long
hash64(long seed, 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(long seed, Iterable<? extends CharSequence> data)
static long
hash64(long seed, Object data)
static long
hash64(long seed, Object[] data)
static long
hash64(long seed, List<? extends CharSequence> data)
long
hash64(short[] data)
long
hash64(CharSequence data)
long
hash64(CharSequence[] data)
long
hash64(CharSequence[]... data)
long
hash64(CharSequence data, int start, int end)
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).long
hash64(Iterable<? extends CharSequence> data)
long
hash64(Object data)
long
hash64(Object[] data)
long
hash64(List<? extends CharSequence> data)
-
Field Details
-
alpha
-
beta
-
gamma
-
delta
-
epsilon
-
zeta
-
eta
-
theta
-
iota
-
kappa
-
lambda
-
mu
-
nu
-
xi
-
omicron
-
pi
-
rho
-
sigma
-
tau
-
upsilon
-
phi
-
chi
-
psi
-
omega
-
alpha_
-
beta_
-
gamma_
-
delta_
-
epsilon_
-
zeta_
-
eta_
-
theta_
-
iota_
-
kappa_
-
lambda_
-
mu_
-
nu_
-
xi_
-
omicron_
-
pi_
-
rho_
-
sigma_
-
tau_
-
upsilon_
-
phi_
-
chi_
-
psi_
-
omega_
-
baal
-
agares
-
vassago
-
samigina
-
marbas
-
valefor
-
amon
-
barbatos
-
paimon
-
buer
-
gusion
-
sitri
-
beleth
-
leraje
-
eligos
-
zepar
-
botis
-
bathin
-
sallos
-
purson
-
marax
-
ipos
-
aim
-
naberius
-
glasya_labolas
-
bune
-
ronove
-
berith
-
astaroth
-
forneus
-
foras
-
asmoday
-
gaap
-
furfur
-
marchosias
-
stolas
-
phenex
-
halphas
-
malphas
-
raum
-
focalor
-
vepar
-
sabnock
-
shax
-
vine
-
bifrons
-
vual
-
haagenti
-
crocell
-
furcas
-
balam
-
alloces
-
caim
-
murmur
-
orobas
-
gremory
-
ose
-
amy
-
orias
-
vapula
-
zagan
-
valac
-
andras
-
flauros
-
andrealphus
-
kimaris
-
amdusias
-
belial
-
decarabia
-
seere
-
dantalion
-
andromalius
-
baal_
-
agares_
-
vassago_
-
samigina_
-
marbas_
-
valefor_
-
amon_
-
barbatos_
-
paimon_
-
buer_
-
gusion_
-
sitri_
-
beleth_
-
leraje_
-
eligos_
-
zepar_
-
botis_
-
bathin_
-
sallos_
-
purson_
-
marax_
-
ipos_
-
aim_
-
naberius_
-
glasya_labolas_
-
bune_
-
ronove_
-
berith_
-
astaroth_
-
forneus_
-
foras_
-
asmoday_
-
gaap_
-
furfur_
-
marchosias_
-
stolas_
-
phenex_
-
halphas_
-
malphas_
-
raum_
-
focalor_
-
vepar_
-
sabnock_
-
shax_
-
vine_
-
bifrons_
-
vual_
-
haagenti_
-
crocell_
-
furcas_
-
balam_
-
alloces_
-
caim_
-
murmur_
-
orobas_
-
gremory_
-
ose_
-
amy_
-
orias_
-
vapula_
-
zagan_
-
valac_
-
andras_
-
flauros_
-
andrealphus_
-
kimaris_
-
amdusias_
-
belial_
-
decarabia_
-
seere_
-
dantalion_
-
andromalius_
-
predefined
Has a length of 192, which may be relevant if automatically choosing a predefined hash functor.
-
-
Constructor Details
-
Method Details
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).- Parameters:
data
- the char array to hashstart
- the start of the section to hash (inclusive)end
- the end of the section to hash (exclusive)- Returns:
- a 64-bit hash code for the requested section of data
-
hash64
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).- Parameters:
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)- Returns:
- a 64-bit hash code for the requested section of data
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).- Parameters:
data
- the char array to hashstart
- the start of the section to hash (inclusive)end
- the end of the section to hash (exclusive)- Returns:
- a 32-bit hash code for the requested section of data
-
hash
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).- Parameters:
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)- Returns:
- a 32-bit hash code for the requested section of data
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).- Parameters:
data
- the char array to hashstart
- the start of the section to hash (inclusive)end
- the end of the section to hash (exclusive)- Returns:
- a 32-bit hash code for the requested section of data
-
hash64
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).- Parameters:
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)- Returns:
- a 32-bit hash code for the requested section of data
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash64
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).- Parameters:
data
- the char array to hashstart
- the start of the section to hash (inclusive)end
- the end of the section to hash (exclusive)- Returns:
- a 32-bit hash code for the requested section of data
-
hash
Hashes only a subsection of the given data, starting at start (inclusive) and ending before end (exclusive).- Parameters:
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)- Returns:
- a 32-bit hash code for the requested section of data
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-
hash
-