【fix sonar】MD5Util文件
This commit is contained in:
+3
-3
@@ -8,7 +8,7 @@ public class MD5Util {
|
||||
|
||||
}
|
||||
|
||||
public static String byteArrayToHexString(byte b[]) {
|
||||
public static String byteArrayToHexString(byte[] b) {
|
||||
StringBuilder resultSb = new StringBuilder();
|
||||
for (int i = 0; i < b.length; i++){
|
||||
resultSb.append(byteToHexString(b[i]));
|
||||
@@ -23,7 +23,7 @@ public class MD5Util {
|
||||
}
|
||||
int d1 = n / 16;
|
||||
int d2 = n % 16;
|
||||
return hexDigits[d1] + hexDigits[d2];
|
||||
return HEX_DIGITS[d1] + HEX_DIGITS[d2];
|
||||
}
|
||||
|
||||
public static String MD5Encode(String origin, String charsetname) {
|
||||
@@ -42,7 +42,7 @@ public class MD5Util {
|
||||
return resultString;
|
||||
}
|
||||
|
||||
private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5",
|
||||
private static final String[] HEX_DIGITS = { "0", "1", "2", "3", "4", "5",
|
||||
"6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user