package com.shzd.common.utils.utils;
import org.apache.commons.codec.digest.DigestUtils;
import java.util.TreeMap;
public class BBLSignUtils {
public static String str2md5(String str){
return DigestUtils.md5Hex(str);
}
public static String getSignStr(TreeMap<String, String> data){
String signStr = "";
for(String key : data.keySet()){
signStr += data.get(key);
}
return signStr;
}
public static void main(String[] args) {
TreeMap data = new TreeMap();
data.put("appid", "");
data.put("token", "");
data.put("wc_appid", "");
long currentTimestamp = UplDateUtils.getCurrentTimestamp();
System.out.println(currentTimestamp);
data.put("timestamp", String.valueOf(currentTimestamp));
String signData = getSignStr(data);
System.out.println(str2md5(signData));;
}
}