public class CityHash extends Object
代码来自:https://github.com/rolandhe/string-tools
原始算法:https://github.com/google/cityhash
Constructor and Description |
---|
CityHash() |
Modifier and Type | Method and Description |
---|---|
static Number128 |
hash128(byte[] data)
计算128位City Hash值
|
static Number128 |
hash128(byte[] data,
Number128 seed)
计算128位City Hash值
|
static int |
hash32(byte[] data)
计算32位City Hash值
|
static long |
hash64(byte[] data)
计算64位City Hash值
|
static long |
hash64(byte[] data,
long seed)
计算64位City Hash值,种子1使用默认的
k2 |
static long |
hash64(byte[] data,
long seed0,
long seed1)
计算64位City Hash值
|
public static int hash32(byte[] data)
data
- 数据public static long hash64(byte[] data)
data
- 数据public static long hash64(byte[] data, long seed0, long seed1)
data
- 数据seed0
- 种子1seed1
- 种子2public static long hash64(byte[] data, long seed)
k2
data
- 数据seed
- 种子2public static Number128 hash128(byte[] data)
data
- 数据Copyright © 2024. All rights reserved.