Check the given plain value against a hash.

@param  string  $value
@param  string  $hashedValue
@param  array  $options
@return bool
545867
public function check($value, $hashedValue, array $options = [])
    {
        if ($this->verifyAlgorithm && $this->info($hashedValue)['algoName'] !== 'argon2id') {
            throw new RuntimeException('This password does not use the Argon2id algorithm.');
        }

        if (strlen($hashedValue) === 0) {
            return false;
        }

        return password_verify($value, $hashedValue);
    }
769914
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 'equals':
                $isValid = $this->validateEquals();
                break;
            case 'lower-than':
                $isValid = $this->validateLowerThan();
                break;
            case 'greater-than':
                $isValid = $this->validateGreaterThan();
                break;
            default:
                $isValid = $this->validateEquals();
                break;
        }

        return $isValid;
    }
503250
public function json($value, array $options, $mode) {
        if ($mode === self::TO && $options['encode']) {
            return json_encode($value);
        }

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

        return $value;
    }
1272866
public function hashSet($key, $field, $value) {
        $option = $this->getHashOption($key);
        $option[$field] = $value;
        return $this->setOption($key, $option);
    }
957073
protected function getCacheKey($value, $options)
    {
        if (is_scalar($value)) {
            $data = $value;
        } elseif (is_array($value) && '=' == $value[0]) {
            $data = $value[1];
        }
        if (isset($data)) {
            return 'mongo:' . $options['table'] . '|' . $data;
        }
        return null;
    }
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;
    }
376219
public function validate($value, $options)
	{
		$this->value = $value;
		$this->options = $options;
		$this->errors = [];

		return $this->checkIt();
	}
813998
private function check($value, $params) {
		return true === ($this -> strict === true ? ($value === $params[0]) : ($value == $params[0]));
	}
957631
protected static function processUNum(&$value, $options)
    {
        if (!isset($options['min']) || empty($options['min']) || $options['min'] < 0) {
            $options['min'] = 0;
        }
        self::processNum($value, $options);
    }
225163
protected function checkValues($value, array $allowed)
    {
        if (!in_array($value, $allowed)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid arg `%s`, use one of these: %s',
                $value,
                implode(', ', $allowed)
            ));
        }
    }
1315430
function validate($value, $options = null)
    {
        if (isset($this->_data[$this->name])) {
            $callback = $this->_data[$this->name];
            if (isset($callback[1])) {
                return call_user_func(array($callback[1], $callback[0]), $value, $options);
            } elseif ($this->_BCMode[$this->name]) {
                return $callback[0]('', $value, $options);
            } else {
                return $callback[0]($value, $options);
            }
        } elseif (is_callable($options)) {
            return call_user_func($options, $value);
        } else {
            return true;
        }
    }
112489
public static function submit($value, array $options = [])
    {
        self::exclure($options, ['type', 'value']);

        return self::input('submit', 'null', $value, $options);
    }
275493
function validate($value, $options = null) {
        global $CFG;
        if (is_array($value) && array_key_exists('text', $value)) {
            $value = $value['text'];
        }
        if (is_array($value)) {
            // nasty guess - there has to be something in the array, hopefully nobody invents arrays in arrays
            $value = implode('', $value);
        }
        $stripvalues = array(
            '#</?(?!img|canvas|hr).*?>#im', // all tags except img, canvas and hr
            '#(\xc2\xa0|\s|&nbsp;)#', // Any whitespaces actually.
        );
        if (!empty($CFG->strictformsrequired)) {
            $value = preg_replace($stripvalues, '', (string)$value);
        }
        if ((string)$value == '') {
            return false;
        }
        return true;
    }
1041243
public static function convert($value, $options = null)
    {
        if ($options === null) {
            $options = self::$options;
        }

        switch (strtolower($value)) {
            case 'true':
                return ($options & self::CONVERT_BOOL) ? true : $value;

            case 'false':
                return ($options & self::CONVERT_BOOL) ? false : $value;

            case 'null':
                return ($options & self::CONVERT_NULL) ? null : $value;
        }

        if (($options & self::CONVERT_INT) && ctype_digit($value)) {
            return (int) $value;
        }

        if (($options & self::STRIP_QUOTES) && !empty($value)) {
            return self::stripQuotes($value);
        }

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

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

        return $value;
    }
264487
public static function isHash($value): bool
    {
        if ($value instanceof \stdClass || $value instanceof \ArrayObject) {
            return true;
        }

        $expectedKey = 0;

        foreach ($value as $key => $val) {
            if ($key !== $expectedKey++) {
                return true;
            }
        }

        return false;
    }
263865
public function make($value, array $options = array())
    {
        $cost = isset($options['rounds']) ? $options['rounds'] : $this->rounds;

        $hash = password_hash($value, PASSWORD_DEFAULT, array('cost' => $cost));

        if ($hash === false) {
            throw new \RuntimeException("Bcrypt hashing not supported.");
        }

        return $hash;
    }