public class Encode extends Object
| 构造器和说明 |
|---|
Encode() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
base64Decode(String str)
BASE64 解码 这里需要强制捕获异常。
|
static byte[] |
base64DecodeAsByte(String str)
BASE64 解码,但以 Byte 形式返回
|
static String |
base64Encode(byte[] bytes)
BASE64 编码
|
static String |
base64Encode(String str)
BASE64 编码
|
static String |
byte2String(byte[] bytes)
字节转编码为 字符串( UTF-8 编码)
|
static String |
byte2String(String str)
字符串转为 UTF-8 编码的字符串
|
static String |
bytesToHex(byte[] bytes)
byte[] 转化为16进制字符串输出
|
static String |
getSHA1(String str)
生成字符串的 SHA1 哈希值
|
static String |
getSHA256(String str)
生成字符串的 SHA2 哈希值
|
static String |
md5(String str)
获取 字符串 md5 哈希值
|
static String |
urlChinese(String str)
URL 网址的中文乱码处理。
|
static String |
urlDecode(String str)
将 URL 编码的字符还原,默认 UTF-8 编码
|
static String |
urlEncode(String str)
将字符进行 URL 编码,默认 UTF-8 编码
|
public static String byte2String(byte[] bytes)
bytes - 输入的字节数组public static String byte2String(String str)
str - 输入的字符串public static String urlDecode(String str)
str - 已 URL 编码的字符串public static String urlEncode(String str)
str - 正常的 Java 字符串public static String urlChinese(String str)
str - 通常是 URL 的 Query String 参数public static String base64Encode(byte[] bytes)
bytes - 输入的字节数组public static byte[] base64DecodeAsByte(String str)
str - 待解码的字符串public static String base64Decode(String str)
str - 待解码的字符串public static String bytesToHex(byte[] bytes)
bytes - Copyright © 2013–2021 AJAXJS. All rights reserved.