ManaPHP\Security\Random::getInt PHP Метод

getInt() публичный Метод

public getInt ( integer $min, integer $max = 2147483647 ) : integer
$min integer
$max integer
Результат integer
    public function getInt($min = 0, $max = 2147483647)
    {
        /** @noinspection TypeUnsafeComparisonInspection */
        if ($min == $max) {
            return $min;
        } else {
            $ar = unpack('l', $this->getByte(4));
            return $min + abs($ar[1]) % ($max - $min + 1);
        }
    }