Get the gravatar hash from an email address.

@param $email

@return bool|string
430211
private function getHash($email)
    {
        try {
            $gravatar_hash = md5(strtolower(trim($email)));
            return $gravatar_hash;
        } catch(Exception $e) {
            return false;
        }
    }
606247
public function get($email, $hash = true)
    {
        $url  = $this->isSecured() ? static::SECURE_URL : static::BASE_URL;
        $url .= empty($email)
            ? str_repeat('0', 32)
            : ($hash ? static::hashEmail($email) : $email);

        $params = $this->getParams($email);

        return $url.'?'.http_build_query($params);
    }
516017
private function getAccessLevels($email)
    {
        foreach ($this->hostedDomains as $hostedDomain) {
            if (preg_match('/'.$hostedDomain['domain_name'].'$/', $email)) {
                return $hostedDomain['access_levels'];
            }
        }

        return null;
    }
1135482
public static function encodeEmail(string $email) : string
    {
        return md5(self::EMAIL_PREF . preg_replace('/\\s/', '', mb_strtolower($email)) . self::EMAIL_SUFF);
    }
1367601
public String getGravatar() {
        if (getEmail() == null) {
            return "http://www.gravatar.com/avatar/00000000000000000000000000000000";
        } else {
            final MD5 md5 = new MD5();
            final String hash = md5.calcMD5(getEmail());
            return "http://www.gravatar.com/avatar/" + hash;
        }
    }
565072
protected function encodeEmail($email)
    {
        if ($email == '')
        {
            return '';
        }
        if (strpos($email, '@') === false)
        {
            return $email; // see #6241
        }
        $arrChunks = explode('@', $email);
        $strHost = array_pop($arrChunks);
        return implode('@', $arrChunks) . '@' . static::encode($strHost);
    }
377645
protected function validateEmail($email) {
        $state['error'] = true;

        if (strlen($email) < (int)$this->config->verify_email_min_length ) {
            $state['message'] = $this->__lang("email_short", (int)$this->config->verify_email_min_length);

            return $state;
        } elseif (strlen($email) > (int)$this->config->verify_email_max_length ) {
            $state['message'] = $this->__lang("email_long", (int)$this->config->verify_email_max_length);

            return $state;
        } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
            $state['message'] = $this->__lang("email_invalid", $email);

            return $state;
        }
        
        if ((int)$this->config->verify_email_use_banlist && $this->isEmailBanned($email)) {
            $this->addAttempt();
            $state['message'] = $this->__lang("email_banned");

            return $state;
        }

        $state['error'] = false;

        return $state;
    }
1356635
public function normalizeEmail($email)
    {
        if (preg_match('#[^(\x20-\x7F)]+#', $email)) {

            list($user, $domain) = explode('@', $email);

            return $user . '@' . $this->punycode($domain);

        } else {
            return $email;
        }
    }
245169
public static function email($email)
    {
        $html = self::getInstance()->html;
        $args = func_get_args();
        return call_user_func_array(array($html, __FUNCTION__), $args);
    }
1077856
public function getUrl($sEmail = null)
    {
        if (null !== $sEmail) {
            $this->setEmail($sEmail);
        }

        return static::URL
            .'avatar/'
            .$this->getHash($this->getEmail())
            .$this->getParams();
    }
1077582
public function getAvatarAttribute()
    {
        $hash = ! empty($this->email) ? md5(strtolower(trim($this->email))) : '';

        return sprintf('//secure.gravatar.com/avatar/%s?d=mm', $hash);
    }
154991
public static function encodeEmail($email)
    {
        if (($pos = strpos($email, '@')) === false) {
            return;
        }
        if (!preg_match('~[\x80-\xFF]~', $email)) {
            return $email;
        }
        $domain = substr($email, ++$pos);
        return substr($email, 0, $pos) . idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
    }
866731
public function getObfuscatedEmail($email)
    {
        if (false !== $pos = strpos($email, '@')) {
            $email = '...'.substr($email, $pos);
        }

        return $email;
    }
792514
public function verifyEmail($email)
    {
        $path = 'users/verify_email';
        $request =  $this->_remoteServer->get($path);
        $request->getQuery()->set('email', $email);
        $response = $request->send();
        return $response->getBody('true');
    }
1019836
public function findTokenByEmail($email)
    {
        $user = $this->users->where('email', $email)->first();

        if (! is_null($user)) {
            return $user->getActivationToken();
        }

        return null;
    }
173377
public function getGoogleBatchServiceGmailForEmail(string $email)
    {
        if (array_key_exists($email, $this->googleBatchServiceGmails)) {
            return $this->googleBatchServiceGmails[$email];
        }

        $googleServiceGmail = new \Google_Service_Gmail($this->serviceAccount->getGoogleBatchClientForEmail($email));
        $this->googleBatchServiceGmails[$email] = $googleServiceGmail;

        return $googleServiceGmail;
    }
1111998
protected static function validateEmailAddress($email) {
		if (empty($email)) {
			throw new InvalidEmailException();
		}

		$email = \trim($email);

		if (!\filter_var($email, \FILTER_VALIDATE_EMAIL)) {
			throw new InvalidEmailException();
		}

		return $email;
	}