package com.jiayue.ipp.idp.util;

import cn.hutool.core.date.DateUtil;
import cn.hutool.crypto.digest.HMac;
import cn.hutool.crypto.digest.HmacAlgorithm;

public class Md5Util {
    /**
     *
     *请求云平台 md5签名
     * @param id
     * @return
     */
    public static String makeMd5(String id) {
        //签名密钥
        byte[] key = "jiayuecloudserver&".getBytes();
        HMac mac = new HMac(HmacAlgorithm.HmacMD5, key);
        //拼接场站编码和今日日期
        String signOrg =  id + DateUtil.today();

        String macHexSign = mac.digestHex(signOrg);
        return macHexSign;
    }
}
