public interface IMessageDigestGenerator
| Modifier and Type | Field and Description |
|---|---|
static EMessageDigestAlgorithm |
DEFAULT_ALGORITHM
The default algorithm that should be used.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAlgorithmName() |
byte[] |
getDigest()
Finish calculation of the hash value and return the digest.
|
byte[] |
getDigest(int nLength)
Get only a part of the digest, namely the first number of bytes.
|
String |
getDigestHexString()
This method converts the current hash digest to a hex string.
|
int |
getDigestLength() |
long |
getDigestLong()
This method finalizes the hash generation and creates the index.
|
void |
reset()
Reset the current hash so that generation can start from scratch again.
|
IMessageDigestGenerator |
update(byte aValue)
Update the hash with the given byte.
|
IMessageDigestGenerator |
update(byte[] aValue)
Update the hash with the given byte array.
|
IMessageDigestGenerator |
update(byte[] aValue,
int nOffset,
int nLength)
Update the hash with a slice of the given byte array.
|
IMessageDigestGenerator |
update(String sValue,
Charset aCharset)
Update the hash with the bytes of the given string in the given charset.
|
IMessageDigestGenerator |
update(String sValue,
String sCharset)
Deprecated.
|
static final EMessageDigestAlgorithm DEFAULT_ALGORITHM
@Nonnegative int getDigestLength()
@Nonnull IMessageDigestGenerator update(byte aValue)
getDigest()
once, no further update is possible.aValue - The byte value to update the hash@Nonnull @Deprecated IMessageDigestGenerator update(@Nonnull String sValue, @Nonnull String sCharset)
getDigest() once, no further update is possible.sValue - The string value to update the hash. May not be null.sCharset - The charset to be used for extraction of the bytes. May not be
null.@Nonnull IMessageDigestGenerator update(@Nonnull String sValue, @Nonnull Charset aCharset)
getDigest() once, no further update is possible.sValue - The string value to update the hash. May not be null.aCharset - The charset to be used for extraction of the bytes. May not be
null.@Nonnull IMessageDigestGenerator update(@Nonnull byte[] aValue)
getDigest() once, no further update is possible.aValue - The byte array to update the hash. May not be null.@Nonnull IMessageDigestGenerator update(@Nonnull byte[] aValue, @Nonnegative int nOffset, @Nonnegative int nLength)
getDigest() once, no further update is possible.aValue - The byte array to update the hash. May not be null.nOffset - The offset within the byte array from which the value should be
taken. May not be < 0.nLength - The number of bytes to use, starting from the passed offset. May not
be < 0.void reset()
@Nonnull @ReturnsMutableCopy byte[] getDigest()
reset() is called.@Nonnull @ReturnsMutableCopy byte[] getDigest(@Nonnegative int nLength)
getDigest() internally so no further update is possible after this
method is called.nLength - The number of bytes to be retrieved. Must be > 0.long getDigestLong()
getDigest() internally so no further update is possible after this
method is called.@Nonnull String getDigestHexString()
getDigest() internally so no further update is possible after this
method is called.null.Copyright © 2006–2014 phloc systems. All rights reserved.