public final class MessageDigests
extends java.lang.Object
MessageDigest
instances for MD5, SHA-1, and
SHA-256 message digests.Constructor | Description |
---|---|
MessageDigests() |
Modifier and Type | Method | Description |
---|---|---|
static java.security.MessageDigest |
md5() |
Returns a
MessageDigest instance for MD5 digests; note
that the instance returned is thread local and must not be
shared amongst threads. |
static java.security.MessageDigest |
sha1() |
Returns a
MessageDigest instance for SHA-1 digests; note
that the instance returned is thread local and must not be
shared amongst threads. |
static java.security.MessageDigest |
sha256() |
Returns a
MessageDigest instance for SHA-256 digests;
note that the instance returned is thread local and must not be
shared amongst threads. |
static java.lang.String |
toHexString(byte[] bytes) |
Format a byte array as a hex string.
|
public static java.security.MessageDigest md5()
MessageDigest
instance for MD5 digests; note
that the instance returned is thread local and must not be
shared amongst threads.MessageDigest
instance that
provides MD5 message digest functionality.public static java.security.MessageDigest sha1()
MessageDigest
instance for SHA-1 digests; note
that the instance returned is thread local and must not be
shared amongst threads.MessageDigest
instance that
provides SHA-1 message digest functionality.public static java.security.MessageDigest sha256()
MessageDigest
instance for SHA-256 digests;
note that the instance returned is thread local and must not be
shared amongst threads.MessageDigest
instance that
provides SHA-256 message digest functionality.public static java.lang.String toHexString(byte[] bytes)
bytes
- the input to be represented as hex.