org.springframework.util.Base64Utils

 

 

        String str = "abc";
        String encode = new String(Base64Utils.encode(str.getBytes()));
        System.out.println("加密后:" + encode);
        String decode = new String(Base64Utils.decode(encode.getBytes()), "utf8");
        System.out.println("解密后:" + decode);

  

posted @ 2023-10-09 14:10  草木物语  阅读(99)  评论(0编辑  收藏  举报