Skip to content

Instantly share code, notes, and snippets.

@chrisjhoughton
Created August 7, 2014 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisjhoughton/5638e46bc3e7b517cb49 to your computer and use it in GitHub Desktop.
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
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