HashFunction adapter for Checksum instances.
| Modifier and Type | Class and Description |
|---|---|
| private class | ChecksumHashFunction.ChecksumHasher
Hasher that updates a checksum. |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final ImmutableSupplier | |
| private static final long | |
| private final String |
| Access | Constructor and Description |
|---|---|
| pack-priv | ChecksumHashFunction(ImmutableSupplier<? extends Checksum> checksumSupplier, int bits, String toString)
|
| Modifier and Type | Method and Description |
|---|---|
| public int | bits()
Implements com. |
| public Hasher | newHasher()
Implements com. Hasher
instance that is ready to receive data.
|
| public String |
| bits | back to summary |
|---|---|
| private final int bits | |
| checksumSupplier | back to summary |
|---|---|
| private final ImmutableSupplier<? extends Checksum> checksumSupplier | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| toString | back to summary |
|---|---|
| private final String toString | |
| ChecksumHashFunction | back to summary |
|---|---|
| pack-priv ChecksumHashFunction(ImmutableSupplier<? extends Checksum> checksumSupplier, int bits, String toString) | |
| bits | back to summary |
|---|---|
| public int bits() Implements com. Doc from com. Returns the number of bits (a multiple of 32) that each hash code produced by this hash function has.
| |
| newHasher | back to summary |
|---|---|
| public Hasher newHasher() Implements com. Doc from com. Begins a new hash code computation by returning an initialized, stateful
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public HashCode | hash()
Implements com. |
| protected void | update(byte b)
Implements abstract com. |
| protected void | update(byte[] bytes, int off, int len)
Overrides com. len bytes starting at off in the given buffer.
|
| checksum | back to summary |
|---|---|
| private final Checksum checksum | |
| ChecksumHasher | back to summary |
|---|---|
| private ChecksumHasher(Checksum checksum) | |
| hash | back to summary |
|---|---|
| public HashCode hash() Implements com. Doc from com. Computes a hash code based on the data that have been provided to this hasher. The result is unspecified if this method is called more than once on the same instance.
| |
| update | back to summary |
|---|---|
| protected void update(byte b) Implements abstract com. Doc from com. Updates this hasher with the given byte.
| |
| update | back to summary |
|---|---|
| protected void update(byte[] bytes, int off, int len) Overrides com. Doc from com. Updates this hasher with
| |