com.github.zhangxd1989.basetool.bloomfilter.filter.FNVFilter Maven / Gradle / Ivy
package com.github.zhangxd1989.basetool.bloomfilter.filter;
import com.github.zhangxd1989.basetool.util.HashUtil;
/**
* FNV Bloom过滤器
*
* @author sheldon
*/
public class FNVFilter extends AbstractFilter {
public FNVFilter(long maxValue, int machineNum) {
super(maxValue, machineNum);
}
public FNVFilter(long maxValue) {
super(maxValue);
}
@Override
public long hash(String str) {
return HashUtil.fnvHash(str) % size;
}
}