将相应的字符串转换成数字
@param string $value the date string to be parsed
@param int $offset starting offset
@param int $minLength minimum length
@param int $maxLength maximum length
@return string parsed integer value
188686
static protected function parseInteger($value, $offset, $minLength, $maxLength)
    {
        for ($len = $maxLength; $len >= $minLength; --$len) {
            $v = self::$_mbstringAvailable ? mb_substr($value, $offset, $len, APP_CHARSET) : substr($value, $offset, $len);
            if (ctype_digit($v) && (self::$_mbstringAvailable ? mb_strlen($v, APP_CHARSET) : strlen($v)) >= $minLength) {
                return $v;
            }
        }
        return false;
    }
1189120
public static function lengthChar($val, $min, $max = null)
    {
        $len = mb_strlen($val, 'utf8');
        $result = ($len >= $min);
        if($max !== null)
        {
            $result = ($result && $len <= $max);
        }
        return $result;
    }
34662
public function range($value, int $min, int $max): bool
    {
        return is_string($value)
            && (mb_strlen($trimmed = trim($value)) >= $min)
            && (mb_strlen($trimmed) <= $max);
    }
633035
public static function rangeLength($value, array $param)
    {
        $length = is_array($value) ? count($value) : mb_strlen($value);

        return $length >= $param[0] && $length <= $param[1];
    }
141034
public function validateStringMaxLength($value, $maxLength, $errorMessage, $errorField = null)
    {
        if (strlen($value) > $maxLength) {
            $this->error($errorMessage);
            $this->_errorFields[] = $errorField;
        }
    }
377524
private String getString(int offset, int maxLength) {
        int index = offset;
        int lastIndex = index + maxLength;
        while (index < lastIndex && (buffer[index] != 0)) {
            index++;
        }
        return new String(buffer, offset, index - offset, StandardCharsets.ISO_8859_1);
    }
1064054
public function length($min, $max = null) {
        if (!$this->_isValid) {
            return $this;
        }
        $length = mb_strlen($this->_unsafeVar, $this->conf['encoding']);
        if ($length < $min || (!is_null($max) && $length > $max)) {
            $this->_isValid = false;
        }
        return $this;
    }
379751
protected function _validator_minlength($input, $value, $min) {
		if (!is_string($value)) return false;
		if (strlen($value) < $min) return false;
		return true;
	}
1340198
public static function isLengthLte($value, $min)
    {
        is_array($min) && $min = $min[0];
        return self::isLength($value, 0, $min);
    }
1210909
public function hasMinLength($minLength)
    {
        $this->isString();

        $this->doCheck(function ($value) use ($minLength) {
            $this->throwExceptionIfFalse(
                mb_strlen($value) >= $minLength,
                'Failed assertion that %s has at least %s characters', $value, $minLength
            );
        });

        return $this;
    }
425034
public function strCookie($key, $minLength = 0, $maxLength = false, $default = false)
	{
		return $this->str($this->cookie($key), $minLength, $maxLength, $default);
	}
1325608
private function max($value, $max)
    {
        if (is_string($value)) {
            $value = strlen($value);
        }

        return $value <= $max;
    }
508669
private function between($value, $min = null, $max = null) {

        $value = intval($value);

        if ($min !== null && $max !== null) {
            return $value >= intval($min) && $value <= intval($max);
        }

        if ($min !== null) {
            return intval($min) <= $value;
        }

        if ($max !== null) {
            return $value <= intval($max);
        }
        return false;
    }
239239
public static function trimToNull(string $value = null, int $maxLength = null)
    {
        if ($value === null) {
            return null;
        }

        // trim it
        $value = trim($value);

        if (!$value) {
            return null;
        }

        if ($maxLength === 0 || $maxLength === null) {
            return $value;
        }

        return substr($value, 0, $maxLength);
    }
91593
public function strSession($key, $minLength = 0, $maxLength = false, $default = false)
	{
		return $this->str($this->session($key), $minLength, $maxLength, $default);
	}
939461
public function padStringFilter($value, $padCharacter, $maxLength, $padType = 'STR_PAD_RIGHT')
    {
        if ($this->isNullOrEmptyString($padCharacter)) {
            throw new \InvalidArgumentException('Pad String Filter cannot accept a null value or empty string as its first argument');
        }
        if ( ! is_int($maxLength)) {
            throw new \InvalidArgumentException('Pad String Filter expects its second argument to be an integer');
        }
        $diff = (function_exists('mb_strlen'))? strlen($value) - mb_strlen($value) : 0;
        $padType = constant($padType);

        return str_pad($value, $maxLength + $diff, $padCharacter, $padType);
    }
41810
public function rule_between( $key, $value, $min, $max )
	{
		return $this->rule_between_num( $key, strlen( $value ), $min, $max );
	}