src/Phpass/Strength/Adapter/Wolfram.php
protected function _calculateSequentialTokenScore($class)
    {
        $score = 0;
        $indices = array ();
        $password = $this->_password;
        $sequences = array ();

        $indices = $this->_getClassIndices($class);
        if ($class == self::CLASS_LETTER) {
            $password = strtolower($password);
        }

        $sequence = '';
        for ($index = 0; $index < count($indices); ++$index) {
            if (isset ($indices[$index + 1]) && $indices[$index + 1] - $indices[$index] == 1 && ord($password[$indices[$index + 1]]) - ord($password[$indices[$index]]) == 1) {
                if ($sequence == '') {
                    $sequence = $password[$indices[$index]] . $password[$indices[$index + 1]];
                } else {
                    $sequence .= $password[$indices[$index + 1]];
                }
            } else {
                if ($sequence != '') {
                    $sequences[] = $sequence;
                    $sequence = '';
                }
            }
        }

        foreach ($sequences as $sequence) {
            if (strlen($sequence) > 2) {
                $score -= (strlen($sequence) - 2) *2;
            }
        }

        return $score;
    }
protected function _calculateSequentialTokenScore($class)
    {
        $score = 0;
        $indices = array ();
        $password = $this->_password;
        $sequences = array ();

        $indices = $this->_getClassIndices($class);
        if ($class == self::CLASS_LETTER) {
            $password = strtolower($password);
        }

        $sequence = '';
        for ($index = 0; $index < count($indices); ++$index) {
            if (isset ($indices[$index + 1]) && $indices[$index + 1] - $indices[$index] == 1 && ord($password[$indices[$index + 1]]) - ord($password[$indices[$index]]) == 1) {
                if ($sequence == '') {
                    $sequence = $password[$indices[$index]] . $password[$indices[$index + 1]];
                } else {
                    $sequence .= $password[$indices[$index + 1]];
                }
            } else {
                if ($sequence != '') {
                    $sequences[] = $sequence;
                    $sequence = '';
                }
            }
        }

        foreach ($sequences as $sequence) {
            if (strlen($sequence) > 2) {
                $score -= (strlen($sequence) - 2) *2;
            }
        }

        return $score;
    }
protected function _calculateSequentialTokenScore ( $ class ) { $ score = 0 ; $ indices = array ( ) ; $ password = $ this -> _password ; $ sequences = array ( ) ; $ indices = $ this -> _getClassIndices ( $ class ) ; if ( $ class == self :: CLASS_LETTER ) { $ password = strtolower ( $ password ) ; } $ sequence = '' ; for ( $ index = 0 ; $ index < count ( $ indices ) ; ++ $ index ) { if ( isset ( $ indices [ $ index + 1 ] ) && $ indices [ $ index + 1 ] - $ indices [ $ index ] == 1 && ord ( $ password [ $ indices [ $ index + 1 ] ] ) - ord ( $ password [ $ indices [ $ index ] ] ) == 1 ) { if ( $ sequence == '' ) { $ sequence = $ password [ $ indices [ $ index ] ] . $ password [ $ indices [ $ index + 1 ] ] ; } else { $ sequence .= $ password [ $ indices [ $ index + 1 ] ] ; } } else { if ( $ sequence != '' ) { $ sequences [ ] = $ sequence ; $ sequence = '' ; } } } foreach ( $ sequences as $ sequence ) { if ( strlen ( $ sequence ) > 2 ) { $ score -= ( strlen ( $ sequence ) - 2 ) * 2 ; } } return $ score ; }
Return the score for sequential tokens of the same class.

@param string $class
The token class on which to base the calculation.
@return integer
Return the score for sequential tokens of the same class .