public final class Hasher extends Object
Modifier and Type | Method and Description |
---|---|
static long |
hash(byte[] array) |
static long |
hash(Bytes bytes) |
static long |
hash(Bytes bytes,
long offset,
long limit) |
static long |
hash(char[] array) |
static long |
hash(int value) |
static long |
hash(long value) |
static <T> long |
hash(T input,
Access<T> access,
long offset,
long length)
Returns the hash code for
len continuous bytes of the given input object,
starting from the given offset. |
public static <T> long hash(T input, Access<T> access, long offset, long length)
len
continuous bytes of the given input
object,
starting from the given offset. The abstraction of input as ordered byte sequence and
"offset within the input" is defined by the given access
strategy.
This method doesn't promise to throw a RuntimeException
if [off, off + len - 1]
subsequence exceeds the bounds of the bytes sequence, defined by access
strategy for the given input
, so use this method with caution.
T
- the type of the inputinput
- the object to read bytes fromaccess
- access which defines the abstraction of the given input
as ordered byte sequenceoffset
- offset to the first byte of the subsequence to hashlength
- length of the subsequence to hashpublic static long hash(Bytes bytes)
public static long hash(Bytes bytes, long offset, long limit)
public static long hash(byte[] array)
public static long hash(char[] array)
public static long hash(int value)
public static long hash(long value)
Copyright © 2015. All rights reserved.