Use SHA256 in Gravatar URLs

This commit is contained in:
Deluan
2024-07-23 17:49:46 -04:00
parent f577704d7a
commit 76c3f5131a
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
package gravatar
import (
"crypto/md5"
"crypto/sha256"
"fmt"
"strings"
)
@@ -13,7 +13,7 @@ const maxSize = 2048
func Url(email string, size int) string {
email = strings.ToLower(email)
email = strings.TrimSpace(email)
hash := md5.Sum([]byte(email))
hash := sha256.Sum256([]byte(email))
if size < 1 {
size = defaultSize
}