public function scoreDifference($passwordOne = null, $passwordTwo = null)
    {
        // check input
        if (!$passwordOne) {
            throw new Doozr_Exception('Missing input parameter one: $passwordOne for calculating score!');
        } elseif (!$passwordOne) {
            throw new Doozr_Exception('Missing input parameter two: $passwordTwo for calculating score!');
        }

        /*
         * basic check - shortcut
         */
        if ($passwordOne == $passwordTwo) {
            return 0;
        }

        /*
         * get cologne phonetic - soundex() works only good on english words
         */
        pre($this->_getColognePhonetic($passwordOne));
        pre($this->_getColognePhonetic($passwordTwo));

        /*
         * calculate difference of length between the two strings
         */
        $scoreDiffLength = abs(strlen($passwordOne) - strlen($passwordTwo));

        /*
         * get ASCII score
         * using different character's
         */
        $scoreDiffAscii = abs($this->_asciiSum($passwordOne) - $this->_asciiSum($passwordTwo)) / 1000;

        pred($scoreDiffAscii);
    }
public function scoreDifference($passwordOne = null, $passwordTwo = null)
    {
        // check input
        if (!$passwordOne) {
            throw new Doozr_Exception('Missing input parameter one: $passwordOne for calculating score!');
        } elseif (!$passwordOne) {
            throw new Doozr_Exception('Missing input parameter two: $passwordTwo for calculating score!');
        }

        /*
         * basic check - shortcut
         */
        if ($passwordOne == $passwordTwo) {
            return 0;
        }

        /*
         * get cologne phonetic - soundex() works only good on english words
         */
        pre($this->_getColognePhonetic($passwordOne));
        pre($this->_getColognePhonetic($passwordTwo));

        /*
         * calculate difference of length between the two strings
         */
        $scoreDiffLength = abs(strlen($passwordOne) - strlen($passwordTwo));

        /*
         * get ASCII score
         * using different character's
         */
        $scoreDiffAscii = abs($this->_asciiSum($passwordOne) - $this->_asciiSum($passwordTwo)) / 1000;

        pred($scoreDiffAscii);
    }
public function scoreDifference ( $ passwordOne = null , $ passwordTwo = null ) { // check input if ( ! $ passwordOne ) { throw new Doozr_Exception ( 'Missing input parameter one: $passwordOne for calculating score!' ) ; } elseif ( ! $ passwordOne ) { throw new Doozr_Exception ( 'Missing input parameter two: $passwordTwo for calculating score!' ) ; } /*
         * basic check - shortcut
         */ if ( $ passwordOne == $ passwordTwo ) { return 0 ; } /*
         * get cologne phonetic - soundex() works only good on english words
         */ pre ( $ this -> _getColognePhonetic ( $ passwordOne ) ) ; pre ( $ this -> _getColognePhonetic ( $ passwordTwo ) ) ; /*
         * calculate difference of length between the two strings
         */ $ scoreDiffLength = abs ( strlen ( $ passwordOne ) - strlen ( $ passwordTwo ) ) ; /*
         * get ASCII score
         * using different character's
         */ $ scoreDiffAscii = abs ( $ this -> _asciiSum ( $ passwordOne ) - $ this -> _asciiSum ( $ passwordTwo ) ) / 1000 ; pred ( $ scoreDiffAscii ) ; }
calculates the score for the differences between two passwords.

This method is intend to calculate a score of difference between two given passwords.
Usage: e.g. scoreDifference('myPassword', 'myPassword123');
Returns an indicator for the

@param string $passwordOne The first password
@param string $passwordTwo The second password

@author Benjamin Carl <opensource@clickalicious.de>

@return float The score

@throws Doozr_Exception
calculates the score for the differences between two passwords .