package com.seer.teach.mall.shipping.jt.auth;

import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;

public class Digests {

    private static final String SLAT = "jadada236t2";

    public static String digestForHead(String json, String privateKey) {
        String signStr = json + privateKey;
        byte[] encode = (new Base64()).encode(DigestUtils.md5(signStr));
        return new String(encode);
    }

    public static String digestForBizParam(String customerCode, String customerPwd, String privateKey) {
        String pwd = DigestUtils.md5Hex(customerPwd + "jadada236t2").toUpperCase();
        byte[] encode = (new Base64()).encode(DigestUtils.md5(customerCode + pwd + privateKey));
        return new String(encode);
    }
}