Created
August 7, 2014 16:58
-
-
Save chrisjhoughton/5638e46bc3e7b517cb49 to your computer and use it in GitHub Desktop.
Get an avatar by a user's email address. Relies on Mout and MD5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var md5 = require("MD5"); | |
var trim = require("mout/string/trim"); | |
module.exports = function (email) { | |
var hash = md5(trim(email).toLowerCase()); | |
return "http://www.gravatar.com/avatar/" + hash; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment