protected function identifierHash($identifier, $hash = 'md5')
    {
        if (filter_var($identifier, FILTER_VALIDATE_EMAIL) || $identifier === null) {
            // If email, we can select our algorithm. Default to md5 for
            // gravatar fallback.
            return hash($hash, $identifier);
        }

        //no email, so the identifier has to be an OpenID
        return hash('sha256', $identifier);
    }
protected function identifierHash($identifier, $hash = 'md5')
    {
        if (filter_var($identifier, FILTER_VALIDATE_EMAIL) || $identifier === null) {
            // If email, we can select our algorithm. Default to md5 for
            // gravatar fallback.
            return hash($hash, $identifier);
        }

        //no email, so the identifier has to be an OpenID
        return hash('sha256', $identifier);
    }
protected function identifierHash ( $ identifier , $ hash = 'md5' ) { if ( filter_var ( $ identifier , FILTER_VALIDATE_EMAIL ) || $ identifier === null ) { // If email, we can select our algorithm. Default to md5 for // gravatar fallback. return hash ( $ hash , $ identifier ) ; } //no email, so the identifier has to be an OpenID return hash ( 'sha256' , $ identifier ) ; }
Create a hash of the identifier.

Create a hash of the email address or openid passed in. Algorithm
used for email address ONLY can be varied. Either md5 or sha256
are supported by the Libravatar API. Will be ignored for openid.

@param string $identifier A string of the email address or openid URL
@param string $hash       A string of the hash algorithm type to make
Uses the php implementation of hash()
MD5 preferred for Gravatar fallback

@return string A string hash of the identifier.

@since Method available since Release 0.1.0
Create a hash of the identifier .