BASE64加密Demo

作者: 李多多 日期: 2019-03-24

BASE64加密Demo

笔记补录:

import java.io.UnsupportedEncodingException;

import sun.misc.BASE64Encoder;
class Demo
{
public static void main(String args[])throws Exception
{
test();
}
public static void test() throws UnsupportedEncodingException
{
BASE64Encoder en = new BASE64Encoder();
String s = en.encode(new String("字符串").getBytes("utf-8"));
System.out.println(s);
}
}