java自带的Base64

2020-02-21  本文已影响0人  778bc750a218
//加密

String encodeToString = Base64.getEncoder().encodeToString(password.getBytes());

System.out.println(encodeToString);

//解码

        byte[] decode = Base64.getDecoder().decode(encodeToString);

System.out.println(new String(decode));
上一篇下一篇

猜你喜欢

热点阅读