Constructor and Description |
---|
URLSafe() |
Modifier and Type | Method and Description |
---|---|
static String |
decode(String base64)
返回通过 URL Safe Base64 解码后的 URL 字符串。
如果传入的字符串不合法,将返回空字符串。 |
static String |
encode(byte[] url,
boolean lineSep)
返回一个 Base64 编码的 URL 字符串
|
static String |
encode(String url)
返回一个不带折行的 Base64 编码的 URL 字符串
|
public static String encode(String url)
Note: 根据 RFC 4648 的规定,把『+』变成『-』,把『/』变成『_』,去除末尾填充的『=』
url
- 需要编码的 URLpublic static String encode(byte[] url, boolean lineSep)
Note: 根据 RFC 4648 的规定,把『+』变成『-』,把『/』变成『_』,去除末尾填充的『=』
url
- 需要编码的 URLlineSep
- 是否在76个字符处添加折行Copyright © 2017. All rights reserved.