Skip to content

Instantly share code, notes, and snippets.

@Cibernomadas Cibernomadas/database.go
Last active Jul 1, 2018

Embed
What would you like to do?
func (u *User) Avatar(s int) string {
if s < 1 || s > 2048 {
s = 128
}
email := []byte(u.Email)
return fmt.Sprintf("https://s.gravatar.com/avatar/%x?d=identicon&s=%d", md5.Sum(email), s)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.