Added method to generate the hash used by Gravatar.com This may be the precursor to adding in some code to support interacting with some third-party web services.

This commit is contained in:
Josh Sherman 2010-12-04 13:20:41 -05:00
parent a3b6753990
commit 2e6a438e52

View file

@ -46,6 +46,26 @@ class String
// }}}
// {{{ Generate Gravatar Hash
/**
* Generate Gravatar Hash
*
* Generates a hash from the passed string that can then be used for
* fetching an avatar from Gravatar.com
*
* @static
* @param string $string string to hash, should be an email address
* @return string resulting hash
*/
public static function generateGravatarHash($string)
{
// Trims whitespace, lowers the case then applies MD5
return md5(strtolower(trim($string)));
}
// }}}
// {{{ Is Empty
/**
@ -75,7 +95,6 @@ class String
// }}}
// {{{ Random
/**