[ISSUES#8905]simplify some code (#8908)
This commit is contained in:
parent
493b99b726
commit
0c61c5d5eb
@ -30,16 +30,13 @@ public class MD5Utils {
|
|||||||
private static final char[] DIGITS_LOWER = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd',
|
private static final char[] DIGITS_LOWER = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd',
|
||||||
'e', 'f'};
|
'e', 'f'};
|
||||||
|
|
||||||
private static final ThreadLocal<MessageDigest> MESSAGE_DIGEST_LOCAL = new ThreadLocal<MessageDigest>() {
|
private static final ThreadLocal<MessageDigest> MESSAGE_DIGEST_LOCAL = ThreadLocal.withInitial(() -> {
|
||||||
@Override
|
try {
|
||||||
protected MessageDigest initialValue() {
|
return MessageDigest.getInstance("MD5");
|
||||||
try {
|
} catch (NoSuchAlgorithmException e) {
|
||||||
return MessageDigest.getInstance("MD5");
|
return null;
|
||||||
} catch (NoSuchAlgorithmException e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate MD5 hex string.
|
* Calculate MD5 hex string.
|
||||||
|
Loading…
Reference in New Issue
Block a user