| 164 | } |
| 165 | |
| 166 | function 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 | |
| 184 | function dxSelectMethod(param) { |
| 185 | return param && param.length > 1024 ? "POST" : "GET"; |