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:
parent
a3b6753990
commit
2e6a438e52
1 changed files with 20 additions and 1 deletions
|
@ -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
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue