MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / getSign

Method getSign

wxapp/iqoo.js:169–177  ·  view source on GitHub ↗
(method, apiPath, data = {})

Source from the content-addressed store, hash-verified

167 }
168
169 getSign(method, apiPath, data = {}) {
170 const upperMethod = method.toUpperCase();
171 const timestamp = Math.floor(Date.now() / 1000);
172 const query = upperMethod === "GET" ? this.queryString(data) : "";
173 const body = upperMethod === "GET" ? "" : JSON.stringify(data || {});
174 const raw = `${upperMethod}&/api/${apiPath}&${query}&${body}&appid=1002&timestamp=${timestamp}`;
175 const signature = crypto.createHmac("sha256", SIGN_SECRET).update(raw).digest("base64");
176 return `IQOO-HMAC-SHA256 appid=1002,timestamp=${timestamp},signature=${signature}`;
177 }
178
179 headers(method, apiPath, data, extra = {}) {
180 return {

Callers 1

headersMethod · 0.95

Calls 1

queryStringMethod · 0.95

Tested by

no test coverage detected