src/Phpass/Strength/Adapter/Base.php
protected function _parseTokens()
    {
        for ($index = 0; $index < $this->_length; ++$index) {
            $token = $this->_password[$index];
            $tokenAsciiValue = ord($token);

            if ($tokenAsciiValue >= 48 && $tokenAsciiValue <= 57) {
                $tokenClass = self::CLASS_NUMBER;
            } elseif ($tokenAsciiValue >= 65 && $tokenAsciiValue <= 90) {
                $tokenClass = self::CLASS_UPPER;
            } elseif ($tokenAsciiValue >= 97 && $tokenAsciiValue <= 122) {
                $tokenClass = self::CLASS_LOWER;
            } else {
                $tokenClass = self::CLASS_SYMBOL;
            }

            // Track the number and index of tokens belonging to class
            ++$this->_tokenCounts[$tokenClass];
            $this->_tokenIndices[$tokenClass][] = $index;

            // Members of UPPER and LOWER also belong to LETTER
            if ($tokenClass == self::CLASS_UPPER || $tokenClass == self::CLASS_LOWER) {
                ++$this->_tokenCounts[self::CLASS_LETTER];
                $this->_tokenIndices[self::CLASS_LETTER][] = $index;
            }

            // Track the number of times this token appears
            if (array_key_exists($token, $this->_tokens)) {
                $this->_tokens[$token] += 1;
            } else {
                $this->_tokens[$token] = 1;
            }
        }
    }
protected function _parseTokens()
    {
        for ($index = 0; $index < $this->_length; ++$index) {
            $token = $this->_password[$index];
            $tokenAsciiValue = ord($token);

            if ($tokenAsciiValue >= 48 && $tokenAsciiValue <= 57) {
                $tokenClass = self::CLASS_NUMBER;
            } elseif ($tokenAsciiValue >= 65 && $tokenAsciiValue <= 90) {
                $tokenClass = self::CLASS_UPPER;
            } elseif ($tokenAsciiValue >= 97 && $tokenAsciiValue <= 122) {
                $tokenClass = self::CLASS_LOWER;
            } else {
                $tokenClass = self::CLASS_SYMBOL;
            }

            // Track the number and index of tokens belonging to class
            ++$this->_tokenCounts[$tokenClass];
            $this->_tokenIndices[$tokenClass][] = $index;

            // Members of UPPER and LOWER also belong to LETTER
            if ($tokenClass == self::CLASS_UPPER || $tokenClass == self::CLASS_LOWER) {
                ++$this->_tokenCounts[self::CLASS_LETTER];
                $this->_tokenIndices[self::CLASS_LETTER][] = $index;
            }

            // Track the number of times this token appears
            if (array_key_exists($token, $this->_tokens)) {
                $this->_tokens[$token] += 1;
            } else {
                $this->_tokens[$token] = 1;
            }
        }
    }
protected function _parseTokens ( ) { for ( $ index = 0 ; $ index < $ this -> _length ; ++ $ index ) { $ token = $ this -> _password [ $ index ] ; $ tokenAsciiValue = ord ( $ token ) ; if ( $ tokenAsciiValue >= 48 && $ tokenAsciiValue <= 57 ) { $ tokenClass = self :: CLASS_NUMBER ; } elseif ( $ tokenAsciiValue >= 65 && $ tokenAsciiValue <= 90 ) { $ tokenClass = self :: CLASS_UPPER ; } elseif ( $ tokenAsciiValue >= 97 && $ tokenAsciiValue <= 122 ) { $ tokenClass = self :: CLASS_LOWER ; } else { $ tokenClass = self :: CLASS_SYMBOL ; } // Track the number and index of tokens belonging to class ++ $ this -> _tokenCounts [ $ tokenClass ] ; $ this -> _tokenIndices [ $ tokenClass ] [ ] = $ index ; // Members of UPPER and LOWER also belong to LETTER if ( $ tokenClass == self :: CLASS_UPPER || $ tokenClass == self :: CLASS_LOWER ) { ++ $ this -> _tokenCounts [ self :: CLASS_LETTER ] ; $ this -> _tokenIndices [ self :: CLASS_LETTER ] [ ] = $ index ; } // Track the number of times this token appears if ( array_key_exists ( $ token , $ this -> _tokens ) ) { $ this -> _tokens [ $ token ] += 1 ; } else { $ this -> _tokens [ $ token ] = 1 ; } } }
Tokenize the password string.

@return void
Tokenize the password string .