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 Summary
-
Method Summary
Modifier and TypeMethodDescriptiondigest()
Returns the digest of all strings passed viaupdate(String)
as hex string.static StringDigestUtil
sha1()
Helper method to createStringDigestUtil
using SHA-1 digest algorithm.static String
Helper method to calculate SHA-1 digest and hex encode it.Updates instance with passed in string.
-
Constructor Details
-
StringDigestUtil
Constructs instance with given algorithm.- See Also:
-
-
Method Details
-
update
Updates instance with passed in string. -
digest
Returns 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:
-
sha1
Helper method to createStringDigestUtil
using SHA-1 digest algorithm. -
sha1
Helper method to calculate SHA-1 digest and hex encode it.
-