import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;
//编码
String s = "Username";
BASE64Encoder encoder = new BASE64Encoder();
s = encoder.encode(s.getBytes("utf-8"));
syso(s);
//解码
BASE64Decoder decoder = new BASE64Decoder();
byte[] bytes = decoder.decodeBuffer(s);
syso(new String(bytes,"utf-8"));
base64编码,解码
最新推荐文章于 2024-04-01 15:31:18 发布