统计区间范围内元素数量
@param $min
@param $max
@return mixed
480742
public function count($min=0, $max=-1)
        {
                if($min!=0 or $max!=-1) {
                        return $this->_redis->zcount($this->_key, $min, $max);
                } else {
                        return $this->_redis->zcard($this->_key);
                }
        }
433202
public function getByFlagRange(int $min, int $max = Settings::FLAG_MAX, int $trackableType = Tracker::TRACKER_ANY, int $perPage = 15) : LengthAwarePaginator
    {
        $query = $this->getModel()->newQuery();

        if ($max === Settings::FLAG_MAX) {
            $query->where('level', '>=', $min);
        } else {
            $query->whereBetween('level', [$min, $max]);
        }

        $query->where($this->typeClosure($trackableType));

        return $query->paginate($perPage);
    }
219931
public function removeByScore($min, $max){
        return $this->getConnection()->getClient()->zRemRangeByScore($this->name, $min, $max);
    }
878222
public function andNotBetween($key, $min, $max)
    {
        $value = sprintf('%s NOT BETWEEN ? AND ?', $key);
        return $this->andAdd($value, [$min, $max]);
    }
1251880
public static function random($min, $max = null)
    {
        if (String::isEmpty($max) ||
            $max > getrandmax()) {
            $max = getrandmax();
        }

        return rand($min, $max);
    }
1199306
function range($min = null, $max = null)
	{
		$this->min($min);
		$this->max($max);
		return $this;
	}
386631
public function setAutoSize($max, $min = 1)
    {
        $this->autoSize = [
            'minRows' => intval($min),
            'maxRows' => intval($max),
        ];

        return $this;
    }
346826
public function generateRandomInt($min, $max)
    {
        try {
            return $this->driverInstance->generateRandomInt($min, $max);
        } catch (\Exception $e) {
            throw new CryptException($e->getMessage());
        }
    }
1153846
public function getInt($name, $min = null, $max = null)
    {
        $value = (int) $this($name);

        if (!is_null($min) && $value < $min) {
            return $min;
        } elseif (!is_null($max) && $value > $max) {
            return $max;
        }

        return $value;
    }
186025
public function length($min = null, $max = null)
	{
		$lastSegmentKey = $this->getLastSegmentKey();

		if (!is_null($min) && !is_null($max) && $max > $min)
		{
			$lengthPattern = sprintf('{%d,%d}', (int) $min, (int) $max);
		}
		elseif (!is_null($min) && !$max)
		{
			$lengthPattern = sprintf('{%d}', (int) $min);
		}
		else
		{
			$lengthPattern = '{1}';
		}

		return $this->replaceQuantifierByKey($lastSegmentKey, $lengthPattern);
	}
805214
public function between($min, $max) {
        $this->check_role = 'between';
        $this->p1 = $min;
        $this->p2 = $max;
        $result = $this->value >= $min && $this->value <= $max;
        $this->checkResult($result);
        return $this;
    }
295301
private static function calculateMeanMicroAmount($min, $max)
    {
        if ($min === null || $max === null) {
            return null;
        }
        if ($min->getMicroAmount() === null
            || $max->getMicroAmount() === null) {
            return null;
        }

        return ($min->getMicroAmount() + $max->getMicroAmount()) / 2;
    }
72396
public static function between($input, $min, $max) {
        $length = mb_strlen($input);

        return ($length <= $max && $length >= $min);
    }
1215465
public function getRand($min = 0, $max = 0x7fffffff)
    {
        $t = ($this->x ^ ($this->x << 11)) & 0x7fffffff;
        $this->x = $this->y;
        $this->y = $this->z;
        $this->z = $this->w;
        $this->w = ( $this->w ^ ($this->w >> 19) ^ ( $t ^ ( $t >> 8 )) );
        return $this->w % ($max - $min + 1) + $min;
    }
191597
protected function lengthValidate($value, $min, $max)
    {
        return $min <= mb_strlen($value) && mb_strlen($value) <= $max;
    }
1288127
public static function number(int $min = 0, int $max = PHP_INT_MAX) : int
    {
        if ($max === $min) {
            return $max;
        }
        $rand = static::bytes(4);
        $rand = hexdec(bin2hex($rand));

        return $min + abs($rand % ($max - $min + 1));
    }
970066
private function binDecode($binary, $min, $max)
        {
            $mid = ($min + $max) / 2;

            if (strlen($binary) == 0) return $mid;

            $bit = substr($binary,0,1);
            $binary = substr($binary,1);

            if ($bit == 1) return $this->binDecode($binary, $mid, $max);
            else return $this->binDecode($binary, $min, $mid);
        }