base64

一.加密

*.若有要求输入字符必须为UTF-8:

则需str.getByte("utf-8");  //在getByte()中指定utf-8编码,否则中文字符将被加密成错乱的字符。

1     /**
2     * params base64加密
3     *
4     */
5        String strParams = new String(req.getParameter("note"));
6        //方法一,可直接使用
7        String enParams = Base64.encodeBase64String(strParams.getBytes()); 
8        //方法二  ,需简单配置一下,配置请看下图
9        String enParams = new BASE64Encoder().encode(strParams.getBytes());

*******配置讲解图*******java——base64 加密和解密

 

二.解密

(待填)

相关文章:

  • 2021-11-28
  • 2022-12-23
  • 2021-10-23
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
猜你喜欢
  • 2022-12-23
  • 2021-10-01
  • 2021-07-03
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
相关资源
相似解决方案