public class ShowApiUtils extends Object
| 构造器和说明 |
|---|
ShowApiUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
byte2hex(byte[] bytes) |
static byte[] |
encryptHMAC(String data,
String secret) |
static byte[] |
encryptMD5(String data) |
static String |
getFileSuffix(byte[] bytes)
获取文件的真实后缀名。
|
static String |
getMimeType(byte[] bytes)
获取文件的真实媒体类型。
|
static String |
signRequest(Map<String,String> params,
String secret,
boolean isHmac)
给请求签名。
|
public static String signRequest(Map<String,String> params, String secret, boolean isHmac) throws IOException
params - 所有字符型的请求参数secret - 签名密钥isHmac - 是否为HMAC方式加密IOExceptionpublic static byte[] encryptHMAC(String data, String secret) throws IOException
IOExceptionpublic static byte[] encryptMD5(String data) throws IOException
IOExceptionpublic static String byte2hex(byte[] bytes)
public static String getFileSuffix(byte[] bytes)
bytes - 文件字节流public static String getMimeType(byte[] bytes)
bytes - 文件字节流Copyright © 2018. All rights reserved.