|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.util.DigestUtils
public abstract class DigestUtils
Miscellaneous methods for calculating digests.
Mainly for internal use within the framework; consider Apache Commons Codec for a more comprehensive suite of digest utilities.
org.apache.commons.codec.digest.DigestUtils| Field Summary | |
|---|---|
private static char[] |
HEX_CHARS
|
private static java.lang.String |
MD5_ALGORITHM_NAME
|
| Constructor Summary | |
|---|---|
DigestUtils()
|
|
| Method Summary | |
|---|---|
private static java.lang.StringBuilder |
appendDigestAsHex(java.lang.String algorithm,
byte[] bytes,
java.lang.StringBuilder builder)
|
static java.lang.StringBuilder |
appendMd5DigestAsHex(byte[] bytes,
java.lang.StringBuilder builder)
Append a hexadecimal string representation of the MD5 digest of the given bytes to the given StringBuilder. |
private static byte[] |
digest(java.lang.String algorithm,
byte[] bytes)
|
private static char[] |
digestAsHexChars(java.lang.String algorithm,
byte[] bytes)
|
private static java.lang.String |
digestAsHexString(java.lang.String algorithm,
byte[] bytes)
|
private static char[] |
encodeHex(byte[] bytes)
|
private static java.security.MessageDigest |
getDigest(java.lang.String algorithm)
Creates a new MessageDigest with the given algorithm. |
static byte[] |
md5Digest(byte[] bytes)
Calculate the MD5 digest of the given bytes. |
static java.lang.String |
md5DigestAsHex(byte[] bytes)
Return a hexadecimal string representation of the MD5 digest of the given bytes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String MD5_ALGORITHM_NAME
private static final char[] HEX_CHARS
| Constructor Detail |
|---|
public DigestUtils()
| Method Detail |
|---|
public static byte[] md5Digest(byte[] bytes)
bytes - the bytes to calculate the digest over
public static java.lang.String md5DigestAsHex(byte[] bytes)
bytes - the bytes to calculate the digest over
public static java.lang.StringBuilder appendMd5DigestAsHex(byte[] bytes,
java.lang.StringBuilder builder)
StringBuilder.
bytes - the bytes to calculate the digest overbuilder - the string builder to append the digest to
private static java.security.MessageDigest getDigest(java.lang.String algorithm)
MessageDigest with the given algorithm. Necessary
because MessageDigest is not thread-safe.
private static byte[] digest(java.lang.String algorithm,
byte[] bytes)
private static java.lang.String digestAsHexString(java.lang.String algorithm,
byte[] bytes)
private static java.lang.StringBuilder appendDigestAsHex(java.lang.String algorithm,
byte[] bytes,
java.lang.StringBuilder builder)
private static char[] digestAsHexChars(java.lang.String algorithm,
byte[] bytes)
private static char[] encodeHex(byte[] bytes)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||