"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SignUtil = void 0;
var crypto = require("crypto");
/**
 * 统一接口签名工具
 */
var SignUtil = /** @class */ (function () {
    function SignUtil() {
    }
    SignUtil.sign = function (data, appSecret) {
        var signStr = Object.keys(data).sort().filter(function (s) {
            if (data[s] === 0 ||
                data[s] ||
                typeof data[s] === 'object' ||
                Array.isArray(data[s]) ||
                ['appId', 'appSecret', 'key'].includes(s)) {
                return false;
            }
            return true;
        }).map(function (k) { return k + "=" + data[k]; }).join('&') + '&' + appSecret;
        return crypto.createHash('md5').update(signStr).digest('hex').toUpperCase();
    };
    return SignUtil;
}());
exports.SignUtil = SignUtil;
//# sourceMappingURL=SignUtil.js.map