public class EncodeKits extends Object
copy from vipshop VJTools(com.vip.vjtools.vjkit.text.EncodeUtil) and made some changes.
| 构造器和说明 |
|---|
EncodeKits() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
decodeBase64(CharSequence input)
Base64解码.
|
static byte[] |
decodeBase64UrlSafe(CharSequence input)
Base64解码, URL安全(将Base64中的URL非法字符'+'和'/'转为'-'和'_', 见RFC3548).
|
static byte[] |
decodeHex(CharSequence input)
Hex解码, 将String解码为byte[].
|
static String |
encodeBase64(byte[] input)
Base64编码.
|
static String |
encodeBase64UrlSafe(byte[] input)
Base64编码, URL安全.
|
static String |
encodeHex(byte[] input)
Hex编码, 将byte[]编码为String,默认为ABCDEF为大写字母.
|
public static String encodeHex(byte[] input)
public static byte[] decodeHex(CharSequence input)
字符串有异常时抛出IllegalArgumentException.
public static String encodeBase64(byte[] input)
public static byte[] decodeBase64(CharSequence input)
如果字符不合法,抛出IllegalArgumentException
public static String encodeBase64UrlSafe(byte[] input)
public static byte[] decodeBase64UrlSafe(CharSequence input)
如果字符不合法,抛出IllegalArgumentException
Copyright © 2019. All rights reserved.