public class PointHash extends IPointHash.LongImpl
CrossHash
;
this version does not include the somewhat-involved finalization step. Omitting finalization helps this class be
somewhat faster, but also makes it so it doesn't avalanche very well. Avalanche refers to the property of a hash
where one changed bit in the input(s) or state has a chance to change any of the output's bits, and should
usually change about 50% of them. You can call avalanche(long)
on the result of a hashAll() call to put
the finalization step back. This has rather good quality when avalanche(long)
is used, but most usage
will not be able to discern a difference between the quality of this (with or without avalanche) and the quality of
HastyPointHash
, where HastyPointHash is a fair amount faster. If your state and input are ints anyway,
consider IntPointHash
, since it's faster than the long-based hashes and still has perfectly fine quality.
IPointHash
and has a long it uses internally for state, exposed by getState()
.IPointHash.IntImpl, IPointHash.LongImpl
Modifier and Type | Field and Description |
---|---|
static PointHash |
INSTANCE |
state
Constructor and Description |
---|
PointHash() |
PointHash(int state) |
PointHash(long state) |
Modifier and Type | Method and Description |
---|---|
static long |
avalanche(long state)
If it's important for some usage that one bit of change in any parameters cause roughly 50% of all bits in
the result to change, then you can call this on the output of any hashAll() overload to improve the bit
avalanche qualities.
|
long |
getState() |
static int |
hash256(long x,
long y,
long state) |
static int |
hash256(long x,
long y,
long z,
long state) |
static int |
hash256(long x,
long y,
long z,
long w,
long state) |
static int |
hash256(long x,
long y,
long z,
long w,
long u,
long v,
long state) |
static int |
hash32(long x,
long y,
long state) |
static int |
hash32(long x,
long y,
long z,
long state) |
static int |
hash32(long x,
long y,
long z,
long w,
long state) |
static int |
hash32(long x,
long y,
long z,
long w,
long u,
long v,
long state) |
static int |
hash64(long x,
long y,
long state) |
static int |
hash64(long x,
long y,
long z,
long state) |
static int |
hash64(long x,
long y,
long z,
long w,
long state) |
static int |
hash64(long x,
long y,
long z,
long w,
long u,
long v,
long state) |
static long |
hashAll(long x,
long y,
long state) |
static long |
hashAll(long x,
long y,
long z,
long state) |
static long |
hashAll(long x,
long y,
long z,
long w,
long state) |
static long |
hashAll(long x,
long y,
long z,
long w,
long u,
long state) |
static long |
hashAll(long x,
long y,
long z,
long w,
long u,
long v,
long state) |
int |
hashWithState(int x,
int y,
int state) |
int |
hashWithState(int x,
int y,
int z,
int state) |
int |
hashWithState(int x,
int y,
int z,
int w,
int state) |
int |
hashWithState(int x,
int y,
int z,
int w,
int u,
int state) |
int |
hashWithState(int x,
int y,
int z,
int w,
int u,
int v,
int state) |
public static final PointHash INSTANCE
public PointHash()
public PointHash(int state)
public PointHash(long state)
public int hashWithState(int x, int y, int state)
public int hashWithState(int x, int y, int z, int state)
public int hashWithState(int x, int y, int z, int w, int state)
public int hashWithState(int x, int y, int z, int w, int u, int state)
public int hashWithState(int x, int y, int z, int w, int u, int v, int state)
public long getState()
public static long avalanche(long state)
state
- the output of hashAll() in this classpublic static long hashAll(long x, long y, long state)
x
- y
- state
- public static long hashAll(long x, long y, long z, long state)
x
- y
- z
- state
- public static long hashAll(long x, long y, long z, long w, long state)
x
- y
- z
- w
- state
- public static long hashAll(long x, long y, long z, long w, long u, long state)
x
- y
- z
- w
- u
- state
- public static long hashAll(long x, long y, long z, long w, long u, long v, long state)
x
- y
- z
- w
- u
- v
- state
- public static int hash256(long x, long y, long state)
x
- y
- state
- public static int hash256(long x, long y, long z, long state)
x
- y
- z
- state
- public static int hash256(long x, long y, long z, long w, long state)
x
- y
- z
- w
- state
- public static int hash256(long x, long y, long z, long w, long u, long v, long state)
x
- y
- z
- w
- u
- v
- state
- public static int hash32(long x, long y, long state)
x
- y
- state
- public static int hash32(long x, long y, long z, long state)
x
- y
- z
- state
- public static int hash32(long x, long y, long z, long w, long state)
x
- y
- z
- w
- state
- public static int hash32(long x, long y, long z, long w, long u, long v, long state)
x
- y
- z
- w
- u
- v
- state
- public static int hash64(long x, long y, long state)
x
- y
- state
- public static int hash64(long x, long y, long z, long state)
x
- y
- z
- state
- public static int hash64(long x, long y, long z, long w, long state)
x
- y
- z
- w
- state
- public static int hash64(long x, long y, long z, long w, long u, long v, long state)
x
- y
- z
- w
- u
- v
- state
- Copyright © Eben Howard 2012–2022. All rights reserved.