public abstract class AbstractStreamingHasher extends AbstractHasher implements StreamingHasher
seed| 构造器和说明 |
|---|
AbstractStreamingHasher() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected int |
asInt(byte[] bytes) |
protected long |
asLong(byte[] bytes) |
long |
hash(byte[] bytes,
int length,
long seed)
一次性计算 hash
Calculate a hash using bytes from 0 to
length, and
the provided seed value |
protected long |
padToLong(byte[] bytes) |
void |
reset() |
protected long |
toLong(byte[] bytes)
当 hash 计算后,结果如果是 byte[] 时,需要使用下面的几个方法进行转换
|
protected void |
update(byte b) |
void |
update(byte[] bytes,
int off,
int len)
用于流式计算
|
createInstance, get, getName, hash, hash, setSeedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHash, setSeedpublic long hash(byte[] bytes,
int length,
long seed)
Calculate a hash using bytes from 0 to length, and
the provided seed value
hash 在接口中 Hasherhash 在类中 AbstractHasherbytes - input byteslength - length of the valid bytes to considerseed - seed valuepublic void update(byte[] bytes,
int off,
int len)
update 在接口中 StreamingHasherprotected void update(byte b)
public void reset()
reset 在接口中 StreamingHasherprotected long toLong(byte[] bytes)
protected int asInt(byte[] bytes)
protected long asLong(byte[] bytes)
protected long padToLong(byte[] bytes)
Copyright © 2022. All rights reserved.