Check the given plain value against a hash.

@param  string  $value
@param  string  $hashedValue
@param  array   $options
@return bool
2385
public function check($value, $hashedValue, array $options = array()) {

        return strtoupper($this->make($value)) === strtoupper($hashedValue);
    }
1077889
private function find($value, $add = false)
    {
        $hash = self::hash($value);
        if(array_key_exists($hash, $this->objects)) {
            return true;
        }
        else if($add) {
            $this->objects[$hash] = $value;
        }
        return false;
    }
1335559
public function needsRehash($hash, $options = null)
    {
        if (is_array($options)) {
            $this->setCost($options['cost']);
        }

        return password_needs_rehash($hash, $this->algorithm(), [
            'cost' => $this->getCost(),
        ]);
    }
1211225
public function check($value, $hashedValue, array $options = [])
    {
        if (strlen($hashedValue) === 0) {
            return false;
        }

        return password_verify($value, $hashedValue);
    }
19462
public function apply($value, $options = [])
    {
        $type = isset($options[0]) ? $options[0] : null;
        switch ($type) {
            case 'int':
            case 'integer':
                return (int) $value;
            case 'real':
            case 'float':
            case 'double':
                return (float) $value;
            case 'string':
                return (string) $value;
            case 'bool':
            case 'boolean':
                return (bool) $value;
            case 'object':
                return is_array($value) ? (object) $value : json_decode($value, false);
            case 'array':
                return json_decode($value, true);
            case 'collection':
                $array = is_array($value) ? $value : json_decode($value, true);
                return new Collection($array);
            default:
                throw new \InvalidArgumentException("Wrong Sanitizer casting format: {$type}.");
        }
    }
1275054
public static function enum(&$value, $options = ['enum'=>[], 'strict'=>false, 'default'=>null])
    {
        if (isset($options['enum']) && is_array($options['enum']) && $options['enum'] != []) {
            $value = in_array($value, $options['enum'], isset($options['strict']) && $options['strict']) ?
                $value : (isset($options['default']) ?
                    $options['default'] : current($options['enum']));
        } else {
            $value = isset($options['default']) ? $options['default'] : null;
        }
        return $value;
    }
973384
public function needsRehash($hashedValue, array $options = array())
    {
        $cost = isset($options['rounds']) ? $options['rounds'] : $this->rounds;

        return password_needs_rehash($hashedValue, PASSWORD_DEFAULT, array('cost' => $cost));
    }
94638
private function check($value, $params) {

		if(true === is_string($value)) {
			return true === in_array($value, $params[0]);
		}

		return false;
	}
1201581
protected function getCacheKey($value, $options)
    {
        if (is_scalar($value)) {
            $data = $value;
        } elseif (is_array($value) && 'eq' == strtolower($value[0])) {
            $data = $value[1];
        }

        if (isset($data)) {
            return 'mongo:' . $options['table'] . '|' . $data;
        } else {
            return md5(serialize($options));
        }
    }
1217773
public static function json(&$value, $options = ['json_assoc'=>true, 'json_schema'=>[], 'default'=>null])
    {
        $json_assoc = isset($options['json_assoc']) && $options['json_assoc'] ? true : false;
        $value = @json_decode(trim($value), $json_assoc);

        if ($value !== null && $json_assoc && isset($options['json_schema']) && $options['json_schema'] && is_array($options['json_schema'])) {
            foreach ($options['json_schema'] as $field => $opt_arr) {
                self::validate(
                    $value[$field],
                    isset($opt_arr[0]) ? $opt_arr[0] : self::NONE_TYPE,
                    isset($opt_arr[1]) && is_array($opt_arr[1]) ? $opt_arr[1] : []
                );
            }
        } elseif ($value === null) {
            $value = isset($options['default']) ? $options['default'] : null;
        }

        return $value;
    }
937672
public function isValid($value)
    {
        $acceptedValues = GeneralUtility::trimExplode('|', $this->options['values']);

        if (false === in_array($value, $acceptedValues)) {
            $errorMessage = $this->translateErrorMessage('validator.has_values.not_valid', 'configuration_object', [implode(', ', $acceptedValues)]);
            $this->addError($errorMessage, 1456140151);
        }
    }
936086
protected function findData($value, array $options)
    {
        /** @var FamilyInterface $family */
        $family = $options['family'];
        /** @var AttributeInterface $attribute */
        $attribute = $options['attribute'];
        /** @var DataRepository $repository */
        $repository = $options['repository'];

        $data = $repository->findByUniqueAttribute($family, $attribute, $value);
        if (null === $data && !$options['ignore_missing']) {
            $msg = "Missing entity for family {$family->getCode()} and";
            $msg .= " attribute {$attribute->getCode()} with value '{$value}'";
            throw new \UnexpectedValueException($msg);
        }

        return $data;
    }
265090
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue($value);
        $this->errors = [];

        switch ($this->options['type']) {
            case 'isbn-10':
                $isValid = $this->validateIsbn10();
                break;
            case 'isbn-13':
                $isValid = $this->validateIsbn13();
                break;
            default:
                $isValid = $this->validateAuto();
                break;
        }
        return $isValid;
    }
461532
final public static function hasNumber ($value, array $options=[]) : bool
	{
		if (!self::hasValue($value))  new ErrorCode(1001);

		// Submitted values are strings, so use is_numeric instead of is_int
		if (!is_numeric($value)) return FALSE;

		if (!empty($options)) return static::hasLength($value, $options);

		return TRUE;
	}
1035376
public function url($value, array $options, $mode) {
        if ($mode === self::TO && $options['encode']) {
            return urlencode($value);
        }

        if ($mode === self::FROM && $options['decode']) {
            return urldecode($value);
        }

        return $value;
    }
848495
public function serialize($value, array $options=[])
    {

        if (!is_string($value)) {
            throw new UnexpectedValueException('I can only work with strings, not ' . Type::of($value));
        }

        return $value;

    }
771190
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue($value);
        $this->errors = [];

        if (\strpos($this->value, '..') !== false || !\preg_match('/^(.+)@([^@]+)$/', $this->value, $matches)) {
            $this->setError(self::VALIDATOR_ERROR_EMAIL_INCORRECT_FORMAT);
            return false;
        }
        if (!\filter_var($this->value, FILTER_VALIDATE_EMAIL) !== false) {
            $this->setError(self::VALIDATOR_ERROR_EMAIL_INCORRECT_FORMAT);
            return false;
        }
        $host = $matches[2];
        if ($this->options['domain-check'] === true && @\gethostbyname($host) === $host) {
            $this->setError(self::VALIDATOR_ERROR_EMAIL_INVALID_DOMAIN);
            return false;
        }
        if ($this->options['mx-check'] === true) {
            return $this->mxCheck($host);
        }

        return true;
    }