REM:
1. 修正MD5返回字符串乱码问题
This commit is contained in:
HuangXin 2021-01-28 18:38:26 +08:00
parent 9f147ed229
commit ad09521250
2 changed files with 4 additions and 2 deletions
src/main/java/com/dispose
ability/impl
security/arithmetic

View File

@ -647,7 +647,9 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
String tsName = objectPrefix + "_" + disposeIp;
if(tsName.length() >= 16) {
int dpTechMaxNameLen = 16;
if(tsName.length() >= dpTechMaxNameLen) {
try {
tsName = objectPrefix + "_" + CryptoHelper.md5Encryption(disposeIp).substring(0, 14);
} catch (NoSuchAlgorithmException e) {

View File

@ -83,7 +83,7 @@ public class CryptoHelper {
public static String md5Encryption(String plaintext) throws NoSuchAlgorithmException {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(plaintext.getBytes(StandardCharsets.UTF_8));
return new String(messageDigest.digest());
return base64Encryption(messageDigest.digest());
}
/**