Validates the checksum (Modulo 43)

@param  string $value The barcode to validate
@return boolean
546175
protected function _code39($value)
    {
        $checksum = substr($value, -1, 1);
        $value    = str_split(substr($value, 0, -1));
        $count    = 0;
        foreach($value as $char) {
            $count += $this->_check[$char];
        }

        $mod = $count % 43;
        if ($mod == $this->_check[$checksum]) {
            return true;
        }

        return false;
    }
1000801
public function isValueValid($value) {
		return $value instanceof Type\Distance || $value instanceof DataType\NumberType || $value instanceof DataType\TextType;
	}
1290065
public function isValid($value)
    {
        $this->setValue($value);

        if (!$this->skipFormat && preg_match($this->pattern, $value) == false) {
            $this->error(self::INVALID_FORMAT);

            return false;
        }

        $value = preg_replace('/[^\d]+/i', '', $value);

        $soma = 0;
        for ($i = 0; $i < 8; $i++) {
            $soma += substr($value, $i, 1) * ($i + 2);
        }

        $soma = $soma % 11;
        $ultimoDigito = ($soma == 10) ? 0 : $soma;
        $digitoInformado = substr($value, strlen($value) - 1, strlen($value));

        if ($ultimoDigito != $digitoInformado) {
            $this->error(self::INVALID_DIGITS);

            return false;
        }

        return true;
    }
595238
public static function validatePublicKey($value)
    {
        $value = preg_replace('/\s+/', ' ', $value);
        if (!strpos($value, ' ')) {
            return false;
        }
        list($type, $key) = explode(' ', $value, 3);
        if (!in_array($type, static::$allowedAlgorithms) || base64_decode($key, true) === false) {
            return false;
        }

        return true;
    }
1284183
public static function hasValidLength($value)
    {
        // Sanitize
        $value  = (int) $value;
        $length = strlen($value);

        // Validate
        return !($length < 9 || $length > 13);
    }
93488
protected function _validate($value)
    {
        $value = trim($value);
        $pattern = '/\pL|[.#@_\s-0-9]/u';

        return is_string($value) && preg_replace($pattern, '', $value);
    }
939899
public function isValueValid($value) {
		return $value instanceof DataType\NumberType || $value instanceof Type\QuantitativeValueType || $value instanceof DataType\TextType;
	}
408918
public function validate($value = "")
    {
        if (is_null($value) && $this->isEmptyAllowed()) {
            return true;
        }

        if ($this->isNullNotAllowed() && is_null($value)) {
            return false;
        }

        return true;
    }
1022110
protected function validate($value)
    {
        $v1 = $this->validator1;
        $v2 = $this->validator2;

        return $v1($value, $this->messenger) xor $v2($value, $this->messenger);
    }
882426
protected function validEncoding($value)
    {
        static $encodings;
        if (isset($encodings) === false && function_exists('mb_list_encodings')) {
            $encodings = mb_list_encodings();
        }

        if (empty($encodings) || \is_array($encodings) === false) {
            // If we can't test the encoding, let it pass through.
            return true;
        }

        return \in_array($value, $encodings, true);
    }
1050595
public static function validate($value)
    {
        if (!is_numeric($value)) {
            return false;
        }

        $stringLength = strlen($value);

        if ($stringLength !== 9 && $stringLength !== 8) {
            return false;
        }

        $sum = 0;
        $multiplier = $stringLength;
        for ($counter = 0; $counter < $stringLength; $counter++, $multiplier--) {
            if ($multiplier == 1) {
                $multiplier = -1;
            }

            $sum += substr($value, $counter, 1) * $multiplier;
        }

        return $sum % 11 === 0;
    }
857229
public function isValid($value)
    {
        $this->_setValue($value);

        if (!is_string($value)) {
            return false;
        }

        return @preg_match(self::LASTMOD_REGEX, $value) == 1;
    }
792969
protected function _validate($value)
    {
        if (!is_string($value)) {
            return false;
        }

        if (stripos($value, (string)  dirname(AnRequest::url()->getUrl(AnHttpUrl::SCHEME | AnHttpUrl::HOST))) !== 0) {
            return false;
        }

        return true;
    }
662361
protected function isValid($value)
    {
        if (!is_numeric($value)) {
            $this->addError('A valid number is expected.', 1221563685);
            return;
        }

        $minimum = $this->options['minimum'];
        $maximum = $this->options['maximum'];
        if ($minimum > $maximum) {
            $x = $minimum;
            $minimum = $maximum;
            $maximum = $x;
        }
        if ($value < $minimum || $value > $maximum) {
            $this->addError('Please enter a valid number between %1$d and %2$d.', 1221561046, [$minimum, $maximum]);
        }
    }
1128505
public static function validate($value)
    {
        if (!is_array($value)) {
            return false;
        }
        if (isset($value['to']) && IdentityValidator::validate($value['to']) === false) {
            return false;
        }
        if (!isset($value['topics']) || !is_array($value['topics'])) {
            return false;
        }
        foreach ($value['topics'] as $topic) {
            if (is_array($topic)) {
                foreach ($topic as $subTopic) {
                    if (HexValidator::validate($subTopic) === false) {
                        return false;
                    }
                }
                continue;
            }
            if (HexValidator::validate($topic) === false) {
                if (!is_null($topic)) {
                    return false;
                }
            }
        }
        return true;
    }
634797
public function isValueValid($value) {
		return $value instanceof Type\DistanceType || $value instanceof DataType\NumberType || $value instanceof DataType\TextType;
	}
183740
public function validate($value)
    {
        // generic pattern match if it's numeric [float/int/double]
        if (!preg_match('/^\d{0,}[.,]?\d*$/', (string)$value)) return false;

        $this->value = $value;

        return true;
    }