import crypto from 'crypto';

// 使用 crypto
const hmacSHA256 = (message, key) => {
    return crypto
        .createHmac('sha256', key)
        .update(message)
        .digest('hex');
};

function A(t) {
    console.log(t.url)
    console.log(t.data)
    var e = t.url + (t.data || "")
    return hmacSHA256(e, "abfc8f9dcf8c3f3d8aa294ac5f2cf2cc7767e5592590f39c3f503271dd68562b")
}


function a(e) {
    for (var t = 1; t < arguments.length; t++) {
        var n = null != arguments[t] ? arguments[t] : {};
        t % 2 ? r(Object(n), !0).forEach((function (t) {
                Object(i["a"])(e, t, n[t])
            }
        )) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : r(Object(n)).forEach((function (t) {
                Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
            }
        ))
    }
    return e
}

var t = {
    "transitional": {"silentJSONParsing": true, "forcedJSONParsing": true, "clarifyTimeoutError": false},
    "transformRequest": [null],
    "transformResponse": [null],
    "timeout": 30000,
    "xsrfCookieName": "XSRF-TOKEN",
    "xsrfHeaderName": "X-XSRF-TOKEN",
    "maxContentLength": -1,
    "maxBodyLength": -1,
    "headers": {
        "common": {"Accept": "application/json, text/plain, */*"},
        "delete": {},
        "get": {"Content-Type": "application/x-www-form-urlencoded"},
        "head": {},
        "post": {"Content-Type": "application/json"},
        "put": {"Content-Type": "application/x-www-form-urlencoded"},
        "patch": {"Content-Type": "application/x-www-form-urlencoded"}
    },
    "baseURL": "https://we.51job.com",
    "withCredentials": true,
    "url": "/api/job/search-pc?api_key=51job&timestamp=1769136341&keyword=%E5%8D%8E%E4%B8%BA%E6%8A%80%E6%9C%AF%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&searchType=2&function=&industry=&jobArea=010000&jobArea2=&landmark=&metro=&salary=&workYear=&degree=&companyType=&companySize=&jobType=&issueDate=&sortType=0&pageNum=1&requestId=&keywordType=&pageSize=20&source=1&accountId=&pageCode=sou%7Csou%7Csoulb&scene=7",
    "method": "get",
    "property": {"keywordType": ""}
};

var b = {
    "partner": "cn_bing_com",
    "webId": 2,
    "fromdomain": "51job_web",
    "frompageUrl": "https://we.51job.com/",
    "pageUrl": "https://we.51job.com/pc/search?jobArea=010000&keyword=%E5%8D%8E%E4%B8%BA%E6%8A%80%E6%9C%AF%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&searchType=2&keywordType=",
    "identityType": "",
    "userType": "",
    "isLogin": "否",
    "accountid": ""
}
console.log(A(t));

// function wordsToHex(words) {
//     // CryptoJS 使用 32 位有符号整数存储，需要处理
//     let hex = '';
//     for (let i = 0; i < words.length; i++) {
//         // 将负数转换为无符号整数
//         const word = words[i] >>> 0;
//         // 转换为十六进制并补零
//         hex += word.toString(16).padStart(8, '0');
//     }
//     return hex;
// }
//
// // 你的数据
// const words = [-762966511, 1702028048, 94455509, -201850815,
//     300412866, 1405396681, 85275542, 246713406];
//
// console.log(wordsToHex(words))

/*
* sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2219be8d71f8213f1-0fd9b910813aa58-4c657b58-3686400-19be8d71f831716%22%2C%22first_id%22%3A%22%22%2C%22props%22%3A%7B%7D%2C%22identities%22%3A%22eyIkaWRlbnRpdHlfY29va2llX2lkIjoiMTliZThkNzFmODIxM2YxLTBmZDliOTEwODEzYWE1OC00YzY1N2I1OC0zNjg2NDAwLTE5YmU4ZDcxZjgzMTcxNiJ9%22%2C%22history_login_id%22%3A%7B%22name%22%3A%22%22%2C%22value%22%3A%22%22%7D%2C%22%24device_id%22%3A%2219be8d71f8213f1-0fd9b910813aa58-4c657b58-3686400-19be8d71f831716%22%7D; ssxmod_itna=1-Gqmx0DuD2Dc0D=Ni73itD2Dp=DmpsKeQDzxCH9P0CCDLxn4xGdY2=Cw3DyD7Tp4RG5DaQi2Yea0xGXKwDA5DnCx7YDt=RcwxK06dvxK=W0mitswe6uDuYLP2GGRRgW_GlDMEHLA6C5N7qxDHwd4KxGLDY=DCqxq57eD4f3Dt4DIDAYDDxDWDYEPxGUQDG=D7rTi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