Package org.axonframework.common.digest
Class Digester
java.lang.Object
org.axonframework.common.digest.Digester
Utility class for generating hashes for values using several algorithms. It uses the
MessageDigest as
underlying mechanism.- Since:
- 2.0
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionReturns the hex representation of the digest of all data that has been provided so far.static StringUtility method that creates a hex string of the MD5 hash of the giveninputstatic DigesternewInstance(String algorithm) Creates a new Digester instance for the givenalgorithm.static DigesterCreates a new Digester instance for the MD5 Algorithmupdate(byte[] additionalData) Update the Digester with givenadditionalData.
-
Method Details
-
newInstance
Creates a new Digester instance for the givenalgorithm.- Parameters:
algorithm- The algorithm to use, e.g. "MD5"- Returns:
- a fully initialized Digester instance
-
newMD5Instance
Creates a new Digester instance for the MD5 Algorithm- Returns:
- a Digester instance to create MD5 hashes
-
md5Hex
Utility method that creates a hex string of the MD5 hash of the giveninput- Parameters:
input- The value to create a MD5 hash for- Returns:
- The hex representation of the MD5 hash of given
input
-
update
Update the Digester with givenadditionalData.- Parameters:
additionalData- The data to add to the digest source- Returns:
thisfor method chaining
-
digestHex
Returns the hex representation of the digest of all data that has been provided so far.- Returns:
- the hex representation of the digest of all data that has been provided so far
- See Also:
-