public final class Coder extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
hash(byte[] bytes,
String algorithm)
哈希运算
|
static byte[] |
hash(File file,
String algorithm) |
static byte[] |
hash(InputStream is,
String algorithm)
哈希输入流
|
static byte[] |
hexDecode(String s)
十六进制解码,组合高低位
|
static String |
hexEncode(byte[] bytes)
十六进制编码,拆分高低位
|
static String |
hmacSha1(byte[] bytes,
byte[] key) |
static String |
md5(byte[] bytes) |
static String |
md5(File file)
MD5加密文件,可用于文件的判重
|
static String |
md5(InputStream is) |
static String |
sha256(byte[] bytes) |
static String |
unicodeDecode(String s)
unicode解码
|
static String |
unicodeEncode(String s)
unicode编码
|
static String |
urlDecode(String url) |
static String |
urlDecode(String url,
Charset charset) |
static String |
urlEncode(String url) |
static String |
urlEncode(String url,
Charset charset) |
public static byte[] hash(byte[] bytes,
String algorithm)
public static String hexEncode(byte[] bytes)
public static byte[] hexDecode(String s)
public static String md5(byte[] bytes)
public static String sha256(byte[] bytes)
public static String hmacSha1(byte[] bytes, byte[] key)
public static byte[] hash(InputStream is, String algorithm)
public static String md5(InputStream is)
Copyright © 2022. All rights reserved.