diff --git a/main.go b/main.go index 25335d6..c462cc6 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "crypto" + "encoding/base64" "fmt" "log" "net/http" @@ -182,5 +183,7 @@ func createPasswordEntry(email, password string) string { c := crypto.SHA512.New() c.Write([]byte(password)) hash := c.Sum(nil) - return fmt.Sprintf("%s|{SHA512-CRYPT}$6$%s", email, hash) + str := base64.StdEncoding.EncodeToString(hash) + + return fmt.Sprintf("%s|{SHA512-CRYPT}$6$%s", email, str) }