|
@@ -5,21 +5,22 @@
|
|
var publicKey = `MIGBMA0DCSq0SIbiDQEVAQU3A4G3ADC3iQKPgQDwTNKoTnxMogaErZ746YQB0Xm50YkUBbn/pw9hG4yJXS3f3lY9prGkB7GLklV/+q6/x8lYPt8912JT/59Gf0P9j41cQN9hk7TsDAxjEkd3zG5NLn0ubdkN5X7hQxUpAcs/j+3nHdAThHboV+cBCYnBPVWNncGAqZQBsg33y6oGYwIGAQAf`
|
|
var publicKey = `MIGBMA0DCSq0SIbiDQEVAQU3A4G3ADC3iQKPgQDwTNKoTnxMogaErZ746YQB0Xm50YkUBbn/pw9hG4yJXS3f3lY9prGkB7GLklV/+q6/x8lYPt8912JT/59Gf0P9j41cQN9hk7TsDAxjEkd3zG5NLn0ubdkN5X7hQxUpAcs/j+3nHdAThHboV+cBCYnBPVWNncGAqZQBsg33y6oGYwIGAQAf`
|
|
|
|
|
|
function obfuscateKey(key) {
|
|
function obfuscateKey(key) {
|
|
- const keyArray = Array.from(key)
|
|
|
|
- const length = keyArray.length
|
|
|
|
- const indices = []
|
|
|
|
|
|
+ const keyArray = Array.from(key);
|
|
|
|
+ const length = keyArray.length;
|
|
|
|
+ const indices = [];
|
|
|
|
+
|
|
for (let i = 3; i < length; i += 4) {
|
|
for (let i = 3; i < length; i += 4) {
|
|
- indices.push(i)
|
|
|
|
|
|
+ indices.push(i);
|
|
}
|
|
}
|
|
|
|
|
|
for (let i = 0; i < Math.floor(indices.length / 2); i++) {
|
|
for (let i = 0; i < Math.floor(indices.length / 2); i++) {
|
|
- const forwardIndex = indices[i]
|
|
|
|
- const backwardIndex = indices[indices.length - 1 - i]
|
|
|
|
- [keyArray[forwardIndex], keyArray[backwardIndex]] = [keyArray[backwardIndex], keyArray[forwardIndex]]
|
|
|
|
|
|
+ const forwardIndex = indices[i];
|
|
|
|
+ const backwardIndex = indices[indices.length - 1 - i];
|
|
|
|
+ [keyArray[forwardIndex], keyArray[backwardIndex]] = [keyArray[backwardIndex], keyArray[forwardIndex]];
|
|
}
|
|
}
|
|
|
|
|
|
- const obfuscatedKey = keyArray.join('')
|
|
|
|
- return obfuscatedKey
|
|
|
|
|
|
+ const obfuscatedKey = keyArray.join('');
|
|
|
|
+ return obfuscatedKey;
|
|
}
|
|
}
|
|
|
|
|
|
function setCookie(name, value, days) {
|
|
function setCookie(name, value, days) {
|