MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / signPayload

Function signPayload

wxapp/tmj.js:57–66  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

55}
56
57function signPayload(data) {
58 const keys = Object.keys(data).sort((a, b) => {
59 const left = `${a}${data[a]}`;
60 const right = `${b}${data[b]}`;
61 if (left > right) return 1;
62 if (left < right) return -1;
63 return 0;
64 });
65 return sha1(keys.map((key) => `${key}${data[key]}`).join(""));
66}
67
68function todayInfo() {
69 const d = new Date();

Callers 1

requestMethod · 0.85

Calls 1

sha1Function · 0.70

Tested by

no test coverage detected