import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import java.io.IOException;
/**
* Created by cuboo on 2016/10/15.
*/
public class Base64code {
public static String encryptBase64(byte[] data){
return new BASE64Encoder().encode(data);
}
public static String decryptBase64(String data) throws IOException {
return new String(new BASE64Decoder().decodeBuffer(data));
}
}
Java中Base64加密和解密
最新推荐文章于 2024-10-05 17:19:19 发布