转成了PHP 请尽情的食用
[PHP] 纯文本查看 复制代码 function encode_1193($N) {
$g = 'https://xyk.mxbc.net/api/v1/h5/marketing/secretword/confirm';
$g .= $N;
$N = (((((sig($g) . '|') . 0) . '|') . time()) . '|1');
$g = ua($N, true);
return urlencode($g);
}
function sig($L) {
$N = 0;
$g = urlencode($L);
for ($B = 0; $B < strlen($g); $B++) {
$N = (($N << 7) - $N) + 398 + ord($g[$B]);
$N |= 0;
}
return $N;
}
function ua($E, $H) {
$W = ['3', '4', '2', '1', '0'];
$P = 0;
while (true) {
switch ($W[$P++]) {
case '0':
switch (strlen($M) % 4) {
default:
case 0:
return $M;
case 1:
return $M . '===';
case 2:
return $M . '==';
case 3:
return $M . '=';
}
continue;
case '1':
if ($H)
return $M;
continue;
case '2':
$M = uu($E, 6, function ($L) use (&$V) {
return $V['uGGDj'][$L];
});
continue;
case '3':
$K = [];
$K['uGGDj'] = 'DGi0YA7BemWnQjCl4+bR3f8SKIF9tUz/xhr2oEOgPpac=61ZqwTudLkM5vHyNXsVJ';
$V = $K;
continue;
case '4':
if (is_null($E))
return '';
continue;
}
break;
}
}
function uu($E, $H, $W) {
if (is_null($E))
return '';
$L = [];
$N = [];
$B = '';
$Q = 2;
$R = 3;
$I = 2;
$T = [];
$w = 0;
$k = 0;
for ($v = 0; $v < strlen($E); $v++) {
$K = $E[$v];
if (isset($L[$K])) {
// Do nothing
} else {
$L[$K] = $R++;
$N[$K] = true;
}
$V = $B . $K;
if (isset($L[$V])) {
$B = $V;
} else {
if (isset($N[$B])) {
if (ord($B[0]) < 256) {
for ($P = 0; $P < $I; $P++) {
$w <<= 1;
if ($k == $H - 1) {
$k = 0;
array_push($T, $W($w));
$w = 0;
} else {
$k++;
}
}
for ($M = ord($B[0]), $P = 0; $P < 8; $P++) {
$w = ($w << 1) | (1 & $M);
if ($k == $H - 1) {
$k = 0;
array_push($T, $W($w));
$w = 0;
} else {
$k++;
}
$M >>= 1;
}
} else {
for ($M = 1, $P = 0; $P < $I; $P++) {
$w = ($w << 1) | $M;
if ($k == $H - 1) {
$k = 0;
array_push($T, $W($w));
$w = 0;
} else {
$k++;
}
$M = 0;
}
for ($M = ord($B[0]), $P = 0; $P < 16; $P++) {
$w = ($w << 1) | (1 & $M);
if ($k == $H - 1) {
$k = 0;
array_push($T, $W($w));
$w = 0;
} else {
$k++;
}
$M >>= 1;
}
}
$Q--;
if ($Q == 0) {
$Q = pow(2, $I);
$I++;
}
unset($N[$B]);
} else {
for ($M = $L[$B], $P = 0; $P < $I; $P++) {
$w = ($w << 1) | (1 & $M);
if ($k == $H - 1) {
$k = 0;
array_push($T, $W($w));
$w = 0;
} else {
$k++;
}
$M >>= 1;
}
}
$Q--;
if ($Q == 0) {
$Q = pow(2, $I);
$I++;
}
$L[$V] = $R++;
$B = (string)$K;
}
if ($B != '') {
if (isset($N[$B])) {
if (ord($B[0]) < 256) {
for ($P = 0; $P < $I; $P++) {
$w <<= 1;
if ($k == $H - 4097) {
$k = 0;
array_push($T, $W($w));
$w = 0;
} else {
$k++;
}
}
for ($M = ord($B[0]), $P = 0; $P < 8; $P++) {
$w = ($w << 1) | (1 & $M);
if ($k == $H - 1) {
$k = 0;
array_push($T, $W($w));
$w = 0;
} else {
$k++;
}
$M >>= 1;
}
} else {
for ($M = 1, $P = 0; $P < $I; $P++) {
$w = ($w << 1) | $M;
if ($k == $H - 1) {
$k = 0;
array_push($T, $W($w));
$w = 0;
} else {
$k++;
}
$M = 0;
}
for ($M = ord($B[0]), $P = 0; $P < 16; $P++) {
$w = ($w << 1) | (1 & $M);
if ($k == $H - 1) {
$k = 0;
array_push($T, $W($w));
$w = 0;
} else {
$k++;
}
$M >>= 1;
}
}
$Q--;
if ($Q == 0) {
$Q = pow(2, $I);
$I++;
}
unset($N[$B]);
} else {
for ($M = $L[$B], $P = 0; $P < $I; $P++) {
$w = ($w << 1) | (1 & $M);
if ($k == $H - 1) {
$k = 0;
array_push($T, $W($w));
$w = 0;
} else {
$k++;
}
$M >>= 1;
}
}
$Q--;
if ($Q == 0) {
$Q = pow(2, $I);
$I++;
}
}
}
for ($M = 2, $P = 0; $P < $I; $P++) {
$w = ($w << 1) | (1 & $M);
if ($k == $H - 1) {
$k = 0;
array_push($T, $W($w));
$w = 0;
} else {
$k++;
}
$M >>= 1;
}
while (true) {
$w <<= 1;
if ($k == $H - 1) {
array_push($T, $W($w));
break;
}
$k++;
}
|