export function jsonSort(jsonObj) {
    let resultObject = {};
    let keys = [];
    for (let key in jsonObj) {
        if (jsonObj.hasOwnProperty(key)) {
            keys.push(key)
        }
    }
    keys.sort();
    keys.forEach(key => {
        resultObject[key] = jsonObj[key];
    })
    return resultObject;
}

import md5 from 'js-md5'

export function generateSign(jsonObj) {
    let obj = jsonSort(jsonObj);
    let str = "SC";
    for (let key in obj) {
        if (obj.hasOwnProperty(key) && obj[key] !== undefined) {
            str += obj[key].toString();
        }
    }
    return md5(str);
}
