uawdijnntqw1x1x1
IP : 18.219.241.228
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
yar.axolotls.ru
/
bitrix
/
modules
/
main
/
lib
/
..
/
lib
/
type
/
randomsequence.php
/
/
<?php namespace Bitrix\Main\Type; /** * Class for generating pseudo random sequences. * Never use it for any security or cryptographic purposes. * * <code> * use \Bitrix\Main\Type\RandomSequence; * $rs = new RandomSequence("A"); * echo $rs->randString(); * </code> */ class RandomSequence { private $mz = 0; private $mw = 0; /** * Starts new sequence of pseudo random values. * * @param string $seed * @return void */ public function __construct($seed = "") { $md = md5($seed); $this->mz = crc32(substr($md, 0, 16)); $this->mw = crc32(substr($md, -16)); } /** * Returns next pseudo random value from the sequence. * The result is signed 32 bit integer. * * @return int */ public function getNext() { $this->mz = 36969 * ($this->mz & 65535) + ($this->mz >> 16); if($this->mz > 0x7FFFFFFF) $this->mz = -(0xFFFFFFFF - $this->mz + 1); $this->mw = 18000 * ($this->mw & 65535) + ($this->mw >> 16); if($this->mw > 0x7FFFFFFF) $this->mw = -(0xFFFFFFFF - $this->mw + 1); //return ($this->mz << 16) + $this->mw; $r = ($this->mz << 16) & 0xFFFF0000; if($r > 0x7FFFFFFF) $r = -(0xFFFFFFFF - $r + 1); $r += $this->mw; if($r > 0x7FFFFFFF) $r = -(0xFFFFFFFF - $r + 1); return ($r & 0xFFFFFFFF); } /** * Returns next pseudo random number value from the sequence. * between $min and $max including borders. * * @param int $min * @param int $max * @return int * @throws \Bitrix\Main\NotSupportedException */ public function rand($min, $max) { if ($min >= $max) throw new \Bitrix\Main\NotSupportedException("max parameter must be greater than min."); $r = sprintf("%u", $this->getNext()) / sprintf("%u", 0xffffffff); return intval($min + $r * ($max - $min + 1)); } /** * Returns next pseudo random string value from the sequence. * * @param int $length * @return string */ public function randString($length = 10) { static $allChars = "abcdefghijklnmopqrstuvwxyzABCDEFGHIJKLNMOPQRSTUVWXYZ0123456789"; $result = ""; for ($i = 0; $i < $length; $i++) { $result .= $allChars[$this->rand(0, 61)]; } return $result; } }
/var/www/axolotl/data/www/yar.axolotls.ru/bitrix/modules/main/lib/../lib/type/randomsequence.php