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

Function dxEncrypt

wxapp/longfor.js:166–182  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

164}
165
166function dxEncrypt(data) {
167 const text = JSON.stringify(data) || "";
168 let output = "";
169 for (let index = 0; index < text.length; ) {
170 const first = text.charCodeAt(index++);
171 const second = text.charCodeAt(index++);
172 const third = text.charCodeAt(index++);
173 const a = first >> 2;
174 const b = ((first & 3) << 4) | (second >> 4);
175 let c = ((second & 15) << 2) | (third >> 6);
176 let d = third & 63;
177 if (Number.isNaN(second)) c = d = 64;
178 else if (Number.isNaN(third)) d = 64;
179 output += DX_ALPHABET.charAt(a) + DX_ALPHABET.charAt(b) + DX_ALPHABET.charAt(c) + DX_ALPHABET.charAt(d);
180 }
181 return output;
182}
183
184function dxSelectMethod(param) {
185 return param && param.length > 1024 ? "POST" : "GET";

Callers 2

detectMethod · 0.85
generateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected