function HmacSHA256(e){ var t = CryptoJS.HmacSHA256(e,CryptoJS.enc.Base64.parse("X5oh6AGsqo0so5Iz9h9DhDOHP3truufLJVgkwJbugGM=")); r = Cryptojs.enc.Base64.stringify(t); return r = encodeURIComponent(r); } var g = { apiurl: "/api/gd/freerdgd/scef/userunicomPhoneJudge/v1", paramName: "USERUNICOM_PHONE_JUDGE_REQ", params: {"PHONE_NO":"175206907xx", "TOKEN" : "8eca2d59bb4ea0fda9271ed7b3544fcd"}, stage: "1"} S = JSON.stringify(g); console.log(HmacSHA256(S));