package com.ydl.ydlcommon.base.config;

import com.ydl.burypointlib.MD5Util;
import com.ydl.ydlcommon.utils.LogUtil;

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

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;
    }
}
