Match sequences of three or more characters.

@copydoc Match::match()

@param       $password
@param array $userInputs

@return array
185885
public static function match($password, array $userInputs = [])
    {
        $matches = [];
        $passwordLength = strlen($password);

        $sequences = self::LOWER.self::UPPER.self::DIGITS;
        $revSequences = strrev($sequences);

        for ($i = 0; $i < $passwordLength; ++$i) {
            $pattern = false;
            $j = $i + 2;
            // Check for sequence sizes of 3 or more.
            if ($j < $passwordLength) {
                $pattern = substr($password, $i, 3);
            }
            // Find beginning of pattern and then extract full sequences intersection.
            if ($pattern && false !== ($pos = strpos($sequences, $pattern))) {
                // Match only remaining password characters.
                $remainder = substr($password, $j + 1);
                $pattern .= static::intersect($sequences, $remainder, $pos + 3);
                $params = [
                    'ascending' => true,
                    'sequenceName' => static::getSequenceName($pos),
                    'sequenceSpace' => static::getSequenceSpace($pos),
                ];
                $matches[] = new static($password, $i, $i + strlen($pattern) - 1, $pattern, $params);
                // Skip intersecting characters on next loop.
                $i += strlen($pattern) - 1;
            }
            // Search the reverse sequence for pattern.
            elseif ($pattern && false !== ($pos = strpos($revSequences, $pattern))) {
                $remainder = substr($password, $j + 1);
                $pattern .= static::intersect($revSequences, $remainder, $pos + 3);
                $params = [
                    'ascending' => false,
                    'sequenceName' => static::getSequenceName($pos),
                    'sequenceSpace' => static::getSequenceSpace($pos),
                ];
                $matches[] = new static($password, $i, $i + strlen($pattern) - 1, $pattern, $params);
                $i += strlen($pattern) - 1;
            }
        }

        return $matches;
    }
309428
protected function specialInputKeys($inputKeys = [])
    {
        $inputKeys = $inputKeys ?: array_keys(request()->all());
        return array_filter($inputKeys, function ($value) {
            return is_string($value) ? starts_with($value, '_') : false;
        });
    }
956084
public function passwordMatches($password, $user)
    {
        if (!is_array($user)) {
            $user = $this->get($user);
        }

        if (empty($user['hash'])) {
            return false;
        }

        return gplcart_string_equals($user['hash'], gplcart_string_hash($password, $user['hash'], 0));
    }
375242
public function matched($input)
    {
        if ($this->token instanceof Token) {
            return $this->token->matched($input);
        }
        
        return $input;
    }
729315
protected static function datesWithSeparators($password)
    {
        $dates = [];
        foreach (static::findAll($password, static::DATE_RX_YEAR_SUFFIX) as $captures) {
            $date = [
                'day' => (int) $captures[1]['token'],
                'month' => (int) $captures[3]['token'],
                'year' => (int) $captures[4]['token'],
                'sep' => $captures[2]['token'],
                'begin' => $captures[0]['begin'],
                'end' => $captures[0]['end'],
            ];
            $dates[] = $date;
        }
        foreach (static::findAll($password, static::DATE_RX_YEAR_PREFIX) as $captures) {
            $date = [
                'day' => (int) $captures[4]['token'],
                'month' => (int) $captures[3]['token'],
                'year' => (int) $captures[1]['token'],
                'sep' => $captures[2]['token'],
                'begin' => $captures[0]['begin'],
                'end' => $captures[0]['end'],
            ];
            $dates[] = $date;
        }

        $results = [];
        foreach ($dates as $candidate) {
            $date = static::checkDate($candidate['day'], $candidate['month'], $candidate['year']);

            if (false === $date) {
                continue;
            }
            list($day, $month, $year) = $date;

            $results[] = [
                'pattern' => 'date',
                'begin' => $candidate['begin'],
                'end' => $candidate['end'],
                'token' => substr($password, $candidate['begin'], $candidate['begin'] + $candidate['end'] - 1),
                'separator' => $candidate['sep'],
                'day' => $day,
                'month' => $month,
                'year' => $year,
            ];
        }

        return $results;
    }
1107451
public static function match($password, array $userInputs = [])
    {
        $matches = [];
        $dicts = static::getRankedDictionaries();
        if (!empty($userInputs)) {
            $dicts['user_inputs'] = [];
            foreach ($userInputs as $rank => $input) {
                $input_lower = strtolower($input);
                $rank = is_numeric($rank) ? $rank : count($dicts['user_inputs']);
                $dicts['user_inputs'][$input_lower] = max(1, $rank);
            }
        }
        foreach ($dicts as $name => $dict) {
            $results = static::dictionaryMatch($password, $dict);
            foreach ($results as $result) {
                $result['dictionary_name'] = $name;
                $matches[] = new static($password, $result['begin'], $result['end'], $result['token'], $result);
            }
        }

        return $matches;
    }
1058454
function ntPasswordHash($password = null)
    {
        if (isset($password)) {
            return pack('H*',hash('md4', $this->str2unicode($password)));
        } else {
            return pack('H*',hash('md4', $this->str2unicode($this->password)));
        }
    }
1174305
public function comparePasswords($userid, $password_for_check)
    {
        $query = "SELECT password FROM {$this->config->table_users} WHERE id = ?";
        $query_prepared = $this->dbh->prepare($query);
        $query_prepared->execute([$userid]);

        $data = $query_prepared->fetch(\PDO::FETCH_ASSOC);

        if (!$data) {
            return false;
        }

        return password_verify($password_for_check, $data['password']);
    }
762583
static public function validPassword($password, $minLength = 6, $maxLength = 18)
    {
        if (!preg_match('/^(?=.*\d)(?=.*[A-Za-z])[0-9A-Za-z!@#$%]{8,12}$/', $password)) {
            return false;
        }
        $length = strlen($password);
        if ($length < $minLength || $length > $maxLength) {
            return false;
        }

        return true;
    }
562969
public static function validate($password, $hash) {
        $params = explode(":", $hash);
        if (count($params) < 4)
            return false;
        $pbkdf2 = base64_decode($params[self::$hash_pbkdf2_index]);
        return self::slowEquals(
                $pbkdf2, self::calculate(
                    $params[self::$hash_alogrithm_index], $password, $params[self::$hash_salt_index], (int) $params[self::$hash_iteration_index], strlen($pbkdf2), true
                )
        );
    }
577881
public function encodePassword(UserInterface $user, $password)
    {
        return $this['security.encoder_factory']->getEncoder($user)->encodePassword($password, $user->getSalt());
    }
591992
protected function match(array $regexes, $string)
    {
        $pattern = '#(?<!like )('.join('|', $regexes).')#i';

        if (preg_match($pattern, $string, $matches)) {
            return $matches;
        }

        return false;
    }
573801
public function withUserInfo($user, $password = null)
    {
        $userInfo = implode(':', [$user, $password]);

        return $this->_clone('userInfo', rtrim($userInfo, ':'));
    }
799138
public function match($input)
    {
        if ($this->token instanceof Token) {
            if ($this->token->matches($input)) {
                return true;
            }
            return false;
        }
        
        if ($this->token === $input) {
            return true;
        }
        return false;
    }
354009
protected function checkUserPassword($username, $password)
    {
        if (!isset($this->users[$username]) || $this->users[$username] !== $password) {
            return false;
        }

        return true;
    }
1203975
protected function getPrefixedInput($input, $prefix = '')
    {
        if( $prefix == '' ) {
            return $input;
        }

        $results = array();
        foreach( $input as $key => $value ) {
            $results[ $prefix .'_'. $key ] = $value;
        }

        return $results;
    }
362222
public function checkCredentials($credentials, UserInterface $user)
    {
        return $this->userPasswordEncoderFactory->isPasswordValid($user, $credentials->getPassword());
    }