Package org.eclipse.aether.util
Class StringDigestUtil
java.lang.Object
org.eclipse.aether.util.StringDigestUtil
A simple digester utility for Strings. Uses 
MessageDigest for requested algorithm. Supports one-pass or
 several rounds of updates, and as result emits hex encoded String.- Since:
- 1.9.0
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiondigest()Returns the digest of all strings passed viaupdate(String)as hex string.static byte[]fromHexString(String hexString) Creates a byte array out of hexadecimal representation of the specified bytes.static StringDigestUtilsha1()Helper method to createStringDigestUtilusing SHA-1 digest algorithm.static StringHelper method to calculate SHA-1 digest and hex encode it.static StringtoHexString(byte[] bytes) Creates a hexadecimal representation of the specified bytes.Updates instance with passed in string.
- 
Constructor Details- 
StringDigestUtilConstructs instance with given algorithm.- See Also:
 
 
- 
- 
Method Details- 
updateUpdates instance with passed in string.
- 
digestReturns the digest of all strings passed viaupdate(String)as hex string. There is no state preserved and due implementation ofMessageDigest.digest(), same applies here: this instance "resets" itself. Hence, the digest hex encoded string is returned only once.- See Also:
 
- 
sha1Helper method to createStringDigestUtilusing SHA-1 digest algorithm.
- 
sha1Helper method to calculate SHA-1 digest and hex encode it.
- 
toHexStringCreates a hexadecimal representation of the specified bytes. Each byte is converted into a two-digit hex number and appended to the result with no separator between consecutive bytes.- Parameters:
- bytes- the bytes to represent in hex notation, may be- null
- Returns:
- the hexadecimal representation of the input or nullif the input wasnull
- Since:
- 2.0.0
 
- 
fromHexStringCreates a byte array out of hexadecimal representation of the specified bytes. If input string isnull,nullis returned. Input value must have even length (due hex encoding = 2 chars one byte).- Parameters:
- hexString- the hexString to convert to byte array, may be- null
- Returns:
- the byte array of the input or nullif the input wasnull
- Since:
- 2.0.0
 
 
-