public class EncodeUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
DEFAULT_CHARSET
默认编码
|
| 构造器和说明 |
|---|
EncodeUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
decodeBase62(String content)
Base62解码
|
static byte[] |
decodeBase64(byte[] bytes)
Base64解码.
|
static String |
decodeBase64(String input)
Base64解码.
|
static String |
decodeHex(String input)
Hex解码.
|
static String |
encodeBase62(String content)
Base62编码
|
static byte[] |
encodeBase64(byte[] bytes)
Base64编码.
|
static String |
encodeBase64(String input)
Base64编码.
|
static String |
encodeHex(byte[] input)
Hex编码.
|
static String |
encodeHex(String input)
Hex编码.
|
static String |
encodeUrlSafeBase64(String data)
Base64编码, URL安全(将Base64中的URL非法字符'+'和'/'转为'-'和'_', 见RFC3548).
|
static byte[] |
getBytes(String content)
获取字符串的字节数组
|
static byte[] |
getBytes(String content,
Charset charset) |
static String |
getString(byte[] content)
转换字节数组为字符串
|
static String |
getString(byte[] content,
Charset charset)
指定编码方式转换字节数组为字符串
|
static String |
hmacSha256(String message,
String secret)
sha256_HMAC加密
|
static String |
urlDecode(String part)
URL 解码, Encode默认为UTF-8.
|
static String |
urlEncode(String part)
URL 编码, Encode默认为UTF-8.
|
public static final String DEFAULT_CHARSET
public static String encodeHex(byte[] input)
input - 字节数组public static byte[] encodeBase64(byte[] bytes)
bytes - 待加密字符串字节数组public static byte[] decodeBase64(byte[] bytes)
bytes - 字符串字节数组public static String encodeBase64(String input)
input - 待加密字符串public static String encodeUrlSafeBase64(String data)
data - 明文public static String urlEncode(String part)
part - 待处理字符串public static String urlDecode(String part)
part - 待处理字符串public static byte[] getBytes(String content)
content - 字符串public static String getString(byte[] content)
content - 字节数组public static String getString(byte[] content, Charset charset)
content - 字符串字节数组charset - 编码Copyright © 2024. All rights reserved.