From 8fcea52f023500d5ada8afc533989592493e79ce Mon Sep 17 00:00:00 2001 From: fwq <582742538@qq.com> Date: 星期一, 09 五月 2022 17:41:43 +0800 Subject: [PATCH] redis工具增加list类型操作 --- src/main/java/com/hx/util/SimpleEncrypt.java | 17 ++++------------- 1 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/hx/util/SimpleEncrypt.java b/src/main/java/com/hx/util/SimpleEncrypt.java index 69909b0..88f48a2 100644 --- a/src/main/java/com/hx/util/SimpleEncrypt.java +++ b/src/main/java/com/hx/util/SimpleEncrypt.java @@ -1,12 +1,6 @@ package com.hx.util; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Random; - -import sun.misc.BASE64Decoder; -import sun.misc.BASE64Encoder; +import java.util.*; /*** * 锟�?鍗曠殑鍔犲瘑绋嬪簭锛屽拰瑙e瘑绋嬪簭 @@ -54,11 +48,7 @@ public static String simpleEnCode(String dataString) { // 缁勬嫾闅忔満鍊� String ranString = generateCheckCode(13).toString() + dataString + generateCheckCode(9).toString(); - - System.out.println(ranString); - // 杩涜鍔犲瘑 sun.misc.BASE64Encoder.BASE64Encoder() - String enCode = new BASE64Encoder().encodeBuffer(ranString.getBytes()); - + String enCode = new String(Base64.getEncoder().encode(ranString.getBytes())); return enCode; } @@ -73,7 +63,8 @@ */ public static String simpleDeCode(String dataString) throws Exception { // 杩涜瑙e瘑sun.misc.BASE64Decoder.BASE64Decoder() - byte[] enCode = new BASE64Decoder().decodeBuffer(dataString); + + byte[] enCode = Base64.getDecoder().decode(dataString); // 瑙e緱闅忔満鍊� String ranString = new String(enCode); -- Gitblit v1.8.0