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

Function makeSign

wxapp/fyzq.js:49–62  ·  view source on GitHub ↗
(params)

Source from the content-addressed store, hash-verified

47}
48
49function makeSign(params) {
50 const text = Object.keys(params)
51 .sort()
52 .filter((key) => params[key] !== null && params[key] !== undefined && params[key] !== "")
53 .map((key) => `${key}=${params[key]}`)
54 .join("&");
55
56 const cipher = crypto.createCipheriv("aes-128-ecb", SIGN_KEY, null);
57 cipher.setAutoPadding(true);
58 return Buffer.concat([
59 cipher.update(Buffer.from(`"${text}"`, "utf8")),
60 cipher.final(),
61 ]).toString("base64").replace(/=/g, "");
62}
63
64function mask(value = "") {
65 value = String(value);

Callers 1

appletPostFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected