• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/type/randomsequence.php
  • Класс: BitrixMainTypeRandomSequence
  • Вызов: RandomSequence::getNext
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);
}