From 28acd2afd0287cfca47bcfb37502f0b062caf2ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=90=A6=E6=B6=9B?= Date: Mon, 13 Mar 2023 10:35:06 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=20sonar=E3=80=91MD5Util=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/jero/common/util/MD5Util.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/MD5Util.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/MD5Util.java index 4ee914c4..9a88560d 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/MD5Util.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/MD5Util.java @@ -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" }; }