public class MyClass {
public static void main(String[] args) {
Map<String, String> map = new TreeMap<String, String>();
map.put("d", "ddddd");
map.put("c", "ccccc");
List<Map.Entry<String, String>> list = new ArrayList<Map.Entry<String, String>>(map.entrySet());
Collections.sort(list, new Comparator<Map.Entry<String, String>>() {
public int compare(Map.Entry<String, String> o1, Map.Entry<String, String> o2) {
return o1.getValue().compareTo(o2.getValue());
}
});
String string = String.valueOf(list.get(0)) + String.valueOf(list.get(1));
MD5s utils = new MD5s();
String str1 = String.valueOf(list.get(0))+"&"+String.valueOf(list.get(1))+"&sign="+utils.MD5JiaMi(string);
System.out.println(str1);
}
}
java自用
最新推荐文章于 2024-03-13 22:01:43 发布