Base64工具类优化Jwt工具类

v1.4.1
Parker 4 years ago
parent 7d48668f28
commit af0ff46fba

@ -1,35 +0,0 @@
package org.opsli.core.utils;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
/**
* Base64
* @author
* @date 2018/11/05 23:10
*/
public final class Base64ConvertUtil {
/**
*
* @param str
* @return java.lang.String
*/
public static String encode(String str) throws UnsupportedEncodingException {
byte[] encodeBytes = Base64.getEncoder().encode(str.getBytes(StandardCharsets.UTF_8));
return new String(encodeBytes);
}
/**
*
* @param str
* @return java.lang.String
*/
public static String decode(String str) throws UnsupportedEncodingException {
byte[] decodeBytes = Base64.getDecoder().decode(str.getBytes(StandardCharsets.UTF_8));
return new String(decodeBytes);
}
// ==============
private Base64ConvertUtil(){}
}
Loading…
Cancel
Save