安全的Base64编码(将Base64中的URL非法字符如+,/=转为其他字符, 见RFC3548). @param data 数据 @return
(String data)
| 17 | * @return |
| 18 | */ |
| 19 | public static String encodeBase64URL(String data){ |
| 20 | if(data != null && !data.isEmpty()){ |
| 21 | return org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString(data.getBytes(StandardCharsets.UTF_8 )); |
| 22 | } |
| 23 | return ""; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * 安全的Base64解码 |
no test coverage detected