From a538020ae3d1af171816187a16ebb0072ea68892 Mon Sep 17 00:00:00 2001
From: Andru <769883346@qq.com>
Date: 星期五, 03 十一月 2023 18:31:11 +0800
Subject: [PATCH] 添加企业微信发送邮件方法

---
 src/main/java/com/hx/util/mysql/aes/MysqlHexAesTool.java |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/hx/util/mysql/aes/MysqlHexAesTool.java b/src/main/java/com/hx/util/mysql/aes/MysqlHexAesTool.java
index 85c1da4..ad8a51b 100644
--- a/src/main/java/com/hx/util/mysql/aes/MysqlHexAesTool.java
+++ b/src/main/java/com/hx/util/mysql/aes/MysqlHexAesTool.java
@@ -41,6 +41,9 @@
             if(data == null){
                 return null;
             }
+            if(!isHexStrValid(data)){
+                return data;
+            }
             if(StringUtils.isEmpty(encoding)){
                 encoding = "UTF-8";
             }
@@ -65,9 +68,7 @@
             if(data == null){
                 return null;
             }
-            if(!isHexStrValid(data)){
-                return data;
-            }
+
             if (StringUtils.isEmpty(encoding)) {
                 encoding = "UTF-8";
             }
@@ -92,9 +93,14 @@
      * @return true or false
      */
     public static boolean isHexStrValid(String str) {
+
         if(str == null){
             return false;
         }
+        //鏄惁32浣嶅�嶆暟
+        if(str.length()%32 != 0){
+            return false;
+        }
         String pattern = "^[0-9A-F]+$";
         return Pattern.compile(pattern).matcher(str).matches();
     }

--
Gitblit v1.8.0