Validate given input for maximum character.

@param $key
@param $length

@return bool
196967
protected function max($key, $length)
    {
        $conCate = '';
        $columnName = ucfirst($this->convertToFieldName($key)).' should be ';
        if (isset($this->errors[$key.self::ERROR])) {
            $conCate = str_replace('.', '', $this->errors[$key.self::ERROR]).' and ';
            $columnName = '';
        }

        if (mb_strlen($this->param[$key]) <= $length) {
            $this->errors[$key.self::ERROR] =
                $conCate.$columnName.'maximum '.$length.' characters.';

            return false;
        }

        return true;
    }
886709
def _validate_maxlength(self, max_length, field, value):
        
        if isinstance(value, Iterable) and len(value) > max_length:
            self._error(field, errors.MAX_LENGTH, len(value))
227121
public function validateMaxLength($length)
    {
        $this->validator_attributes[] = 'data-parsley-maxlength="' . (int)$length . '"';

        $this->validator_checks['max_length'] = (int)$length;

        return $this;
    }
63019
public function validate($key)
    {
        if (empty($this->signature)) {
            throw new RuntimeException('No foreign signature available');
        }

        return strcmp($this->signature, $this->getEncodedSignature($key)) === 0;
    }
1171657
public function maxLength($key, $maxLength, $message = null)
    {
        if (is_array($key)) {
            foreach ($key as $k => $name) {
                $this->maxLength($name, is_array($maxLength) ? $maxLength[$k] : $maxLength, $message);
            }
        } else {
            if (isset($this->scope[$key]) && mb_strlen($this->scope[$key]) > $maxLength) {
                $this->errors[$key] = sprintf($message !== null ? $message : self::$maxLengthMessage, $key, $maxLength);
            }
        }

        return $this;
    }
405084
public function minLength($key, $minLength, $message = null)
    {
        if (is_array($key)) {
            foreach ($key as $k => $name) {
                $this->minLength($name, is_array($minLength) ? $minLength[$k] : $minLength, $message);
            }
        } else {
            if (isset($this->scope[$key]) && mb_strlen($this->scope[$key]) < $minLength) {
                $this->errors[$key] = sprintf($message !== null ? $message : self::$minLengthMessage, $key, $minLength);
            }
        }

        return $this;
    }
713586
protected function keygen($length)
	{
		$chars = str_shuffle('3759402687094152031368921');
		$chars = str_shuffle(str_repeat($chars, ceil($length / strlen($chars))));
		
		return strrev(str_shuffle(substr($chars, mt_rand(0, (strlen($chars) - $length - 1)), $length)));
	}
941324
protected function _formKey($key, $string)
    {
        $key = '_' . $key;
        $keyLength = (strlen($string) / strlen($key)) + 5;

        return str_repeat($key, $keyLength);
    }
390446
protected final function _isValidInt($key,$value){

        if(!is_numeric($value) || strpos($value,'.') !== false){
            return $this->setError($key,"`{$key}` must be a integer");
        }//if

        if(!$this->_isBetweenMinAndMax($key,$value)){
            return false;
        }//if

        return true;

    }
1111195
function setKeyLength($length)
    {
        if ($length < 32) {
            $this->key_length = 4;
        } elseif ($length > 448) {
            $this->key_length = 56;
        } else {
            $this->key_length = $length >> 3;
        }

        parent::setKeyLength($length);
    }
1300323
public static Validation<String> length(int minSize, int maxSize) {
        return moreThan(minSize).and(lessThan(maxSize));
    }
140145
protected function _validator_max($input, $value, $max) {
		if (!is_string($value) && !is_integer($value) && !is_float($value)) return false;
		if (is_string($value)) $value = (int)$value;
		return $value <= $max;
	}
1231645
function strlen(key, req) {
  var val = this.getKey(key, req);
  if(!val) return 0;
  if(val instanceof Buffer) return val.length;
  // redis compatible, return byte length
  return Buffer.byteLength(val);
}
1020966
public function getRange($key, $length) {
        $badKeys = [];

        for ($i = 0; $i < $key; $i++) {
            array_push($badKeys, $i);
        }

        for ($i = $key + $length; $i < count($this->_datas); $i++) {
            array_push($badKeys, $i);
        }

        return array_diff_key($this->_datas, array_flip($badKeys));
    }
83387
public function _validation_min_length($val, $length)
	{
		return $this->_empty($val) || \Str::length($val) >= $length;
	}
374306
public static function validateKey ($key)
    {
        $hash = substr($key, 0, 2);
        $encrypted = substr($key, 2);
        if ($hash != substr(md5(Pluf::f('secret_key') . $encrypted), 0, 2)) {
            throw new Pluf_Form_Invalid(
                    __(
                            'The validation key is not valid. Please copy/paste it from your confirmation email.'));
        }
        $cr = new Pluf_Crypt(md5(Pluf::f('secret_key')));
        return explode(':', $cr->decrypt($encrypted), 3);
    }
18353
public function _validation_max_length($val, $length)
	{
		return $this->_empty($val) || \Str::length($val) <= $length;
	}