This commit is contained in:
josh 2024-05-07 08:00:34 -04:00
parent 07385a6a89
commit 5b97b753ed
1 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package main
import ( import (
"crypto" "crypto"
"encoding/base64"
"fmt" "fmt"
"log" "log"
"net/http" "net/http"
@ -182,5 +183,7 @@ func createPasswordEntry(email, password string) string {
c := crypto.SHA512.New() c := crypto.SHA512.New()
c.Write([]byte(password)) c.Write([]byte(password))
hash := c.Sum(nil) 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)
} }