import org.apache.commons.codec.digest.DigestUtils; public class Gravatar { private final static String URL = "http://www.gravatar.com/avatar/"; public String getId(String mail) { return DigestUtils.md5Hex(mail.toLowerCase().trim()); } public String getAvatarUrl(String mail) { return URL + getId(mail); } }