本文共 361 字,大约阅读时间需要 1 分钟。
代码:
public static void main(String[] args) { String str = "abc123456"; String asB64 = new String(Base64.encodeBase64(str.getBytes()));//加密 System.out.println(asB64); String str2 = new String(Base64.decodeBase64(asB64.getBytes()));//解密 System.out.println(str2); }
输出如下:
YWJjMTIzNDU2abc123456Process finished with exit code 0
转载地址:http://tceff.baihongyu.com/