-1

Помогите, пожалуйста, перевести данный код на php. Или подскажите откуда взялся b[h] и аналог slice на php.

Буду очень блогодарян, заранее спасибо за внимание!

var c = 181874,d = 8715824,e = 42841287,f = 8424317,d = 328901,g = 7689,j = 733880,n = 432350,z = 1241412,h = 1191240,l = 124412412,t = (new Date()).valueOf();
c = d / c;
j = /(?=\B(?:\d{3})+(?!\d))/g;
h = Math.round(Math.random() * (5 - 0) + 0);
l = Math.random() * (e - n) + g;
z = parseInt(l / c) + '';
b = z.slice(0, 4).replace(/(?=\B(?:\d{2})+(?!\d))/g, b[h]) .replace(/(?=\B(?:\d{1})+(?!\d))/g, b[Math.round(Math.random() * (5 - 0) + 0)]);

1 ответ 1

0

Сам придумал, сам обиделся , сделал )))) все ок).

 function random() {
  return (float)rand()/(float)getrandmax();
}


  $b = 'chrome';
    $c = 181874;
    $d = 8715824;
    $e = 42841287;
    $f = 8424317;
    $d = 328901;
    $g = 7689;
    $j = 733880;
    $n = 432350;
    $z = 1241412;
    $h = 1191240;
    $l = 124412412;
    $t = time();
    $c = $d / $c;
    $j = '/(?=\B(?:\d{3})+(?!\d))/g';
    $h = round($this->random() * (5 - 0) + 0);
    $l = $this->random() * ($e - $n) + $g;
    $z = intval($l / $c) + '';
    $temp = preg_replace('/(?=\B(?:\d{2})+(?!\d))/i', $b[$h], substr($z, 0, 4));
    $b = preg_replace('/(?=\B(?:\d{1})+(?!\d))/', $b[round($this->random() * (5 - 0) + 0)], $temp);
1
  • И что за разработчики придумывают такие тупые хаши )))) 21 сен 2017 в 19:40

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.