From 5b97b753ed06597f2ff29430c8fea3bb92555e58 Mon Sep 17 00:00:00 2001 From: josh Date: Tue, 7 May 2024 08:00:34 -0400 Subject: [PATCH] base64 --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) }