public class Hashs extends Object
| 构造器和说明 |
|---|
Hashs() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Hasher |
getHasher(String hasherName,
Object initParams)
Get a singleton instance of hash function of a given type.
|
static long |
hash(Hasher hasher,
byte[] bytes)
Calculate a hash using all bytes from the input argument, and
a seed of 0.
|
static long |
hash(Hasher hasher,
byte[] bytes,
int length,
long seed)
一次性计算 hash
Calculate a hash using bytes from 0 to
length, and
the provided seed value |
static long |
hash(Hasher hasher,
byte[] bytes,
long seed)
一次性计算 hash
Calculate a hash using all bytes from the input argument,
and a provided seed value.
|
static long |
hash(String hasher,
Object initParams,
byte[] bytes,
int length,
long seed) |
public static long hash(Hasher hasher, byte[] bytes)
bytes - input bytespublic static long hash(Hasher hasher, byte[] bytes, long seed)
Calculate a hash using all bytes from the input argument, and a provided seed value.
bytes - input bytesseed - seed valuepublic static long hash(Hasher hasher, byte[] bytes, int length, long seed)
Calculate a hash using bytes from 0 to length, and
the provided seed value
bytes - input byteslength - length of the valid bytes to considerseed - seed valueCopyright © 2022. All rights reserved.