Check if the given hash has been hashed using the given options.

@param  string  $hashedValue
@param  array   $options
@return bool
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));
    }
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;
    }
1049111
public function calculate($someValue)
    {
        if (!isset($this->calculatedHashes[$someValue])) {
            $this->calculatedHashes[$someValue] = md5($someValue);
        }
        return $this->calculatedHashes[$someValue] = md5($someValue);
    }
507753
protected static function checkOptions(array $options)
    {
        if (isset($options['value'])) {
            $value = $options['value'];
            unset($options['value']);
            $options['value'] = $value;
        }

        return $options;
    }
1071489
public static function compare($hash1, $hash2): bool {
        if(!is_string($hash1)) {
            $hash1 = (string) $hash1;
        }
        if(!is_string($hash2)) {
            $hash2 = (string) $hash2;
        }
        return hash_equals($hash1, $hash2);
    }
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;
	}
232723
public static function hashVerify($hashed, $hash) : bool {
      $hasher = new \Nuki\Handlers\Security\Hasher(
          self::getAppAlgorithm(),
          self::getAppKey()
      );
      
      return $hasher->verify($hashed, $hash);
    }
1298290
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue($value);
        $this->errors = [];

        $validType = $this->validateType();
        $validGT = $this->validateGreaterThan();
        $validLT = $this->validateLowerThan();

        return $validType && $validGT && $validLT;
    }
882277
public function hash($options) {
		$mediaSalt = Configure::read('Imagine.salt');
		if (empty($mediaSalt)) {
			throw new \RuntimeException(__d('imagine', 'Please configure {0} using {1}', 'Imagine.salt', 'Configure::write(\'Imagine.salt\', \'YOUR-SALT-VALUE\')'));
		}
		ksort($options);
		return urlencode(Security::hash(serialize($options) . $mediaSalt));
	}
808974
protected function decrypt($value, $options)
    {
        $secure = $this->secure($options);

        return $secure->decrypt($value);
    }
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;
    }
1085102
public static function hasInternalExpireTime($unserializedValue)
    {
        return (
            is_array($unserializedValue)
            && array_key_exists('v', $unserializedValue)
            && array_key_exists('s', $unserializedValue)
            && array_key_exists('ts', $unserializedValue)
        );
    }
347417
public static function invoke(
        array $fieldResults,
        array $options = []
    ): bool {
        /** @var ValidationResult $validationResult */
        foreach ($fieldResults as $validationResult) {
            if (!$validationResult->isValid()) {
                return false;
            }
        }

        return true;
    }
1133742
public function isSelectedValue($dataValue, $userValue)
    {
        if (!$this->isMultiple() || !is_array($userValue)) {
            return parent::isSelectedValue($dataValue, $userValue);
        }
        
        return in_array($dataValue, $userValue);
    }
196622
protected function generateCheckbox($options, $currentValue = null)
    {
        $hidden = sprintf('<input type="hidden" name="%s" value="0">', $options['name']);
        $chk = sprintf('<input %s %s>', $this->arrayToHtmlAttributes($options), $options['value'] == $currentValue ? ' checked="checked"' : '');
        return $hidden . $chk;
    }
1062370
protected function isCurrencyValid($currencyValue)
    {
        $availableCurrencies = $this->facade->getAvailableCurrencies();
        /** @var Currency $currency */
        $currencyFound = false;
        foreach ($availableCurrencies as $currency) {
            if ($currencyValue == $currency->getCode()) {
                $currencyFound = true;
            }
        }
        if (!$currencyFound) {
            throw new InvalidConditionValueException(
                \get_class(),
                'currency'
            );
        }

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

        if ($this->options['type'] == 'any') {
            $types = \array_keys($this->validationData);
        } elseif (\array_key_exists($this->options['type'], $this->validationData)) {
            $types = [$this->options['type']];
        } else {
            throw new DomainException('Unsopported credit card type: '.$this->options['type']);
        }

        $validType = $this->validateType($types);
        $validNumber = $this->validateNumber();

        return $validType && $validNumber;
    }