package com.ydl.ydlcommon.base.config;


import com.ydl.ydlcommon.utils.MD5Util;

/**
 * Created by Ykai on 2021/1/11.
 * <p>
 * 获取加密参数类
 */

public class EncryptionParams {
    public static String getSign(String path, String timestamp) {
//        Map<String,String> map = new HashMap<>();
//        map.put("timestamp",timestamp);
//        map.put("path",path);
//        map.put("version", "1.0.0");
//
//        List<String> storedKeys = Arrays.stream(map.keySet()
//                .toArray(new String[]{}))
//                .sorted(Comparator.naturalOrder())
//                .collect(Collectors.toList());
//        String sign = storedKeys.stream()
//                .map(key -> key+map.get(key))
//                .collect(Collectors.joining()).trim()
//                .concat();
        String sign = ("path"+path+"timestamp"+timestamp+"version1.0.0").concat(HttpConfig.Companion.getENCRYPTION_APP_SECRET());
        sign = MD5Util.md5(sign).toUpperCase();
        return sign;
    }
}
