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[] |
getAllDigestBytes()
Finish calculation of the hash value and return the digest.
|
byte[] |
getAllDigestBytes(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.
|
Provider |
getSecurityProvider() |
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.
|
static final EMessageDigestAlgorithm DEFAULT_ALGORITHM
@Nonnull Provider getSecurityProvider()
null.@Nonnegative int getDigestLength()
@Nonnull IMessageDigestGenerator update(byte aValue)
getAllDigestBytes() once, no further update is possible.aValue - The byte value to update the hash@Nonnull IMessageDigestGenerator update(@Nonnull String sValue, @Nonnull Charset aCharset)
getAllDigestBytes() 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)
getAllDigestBytes() 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)
getAllDigestBytes() 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[] getAllDigestBytes()
reset() is called.@Nonnull @ReturnsMutableCopy byte[] getAllDigestBytes(@Nonnegative int nLength)
getAllDigestBytes() 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()
getAllDigestBytes() internally so no further update is possible
after this method is called.@Nonnull String getDigestHexString()
getAllDigestBytes() internally so no further update is possible
after this method is called.null.Copyright © 2014–2015 Philip Helger. All rights reserved.