20 lines
303 B
Go
20 lines
303 B
Go
// Copyright (C) 2022 Marius Schellenberger
|
|
|
|
package db
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
"time"
|
|
)
|
|
|
|
func validatePassword(pw string) []byte {
|
|
hash := sha256.New()
|
|
hash.Write([]byte(pw))
|
|
return hash.Sum(nil)
|
|
}
|
|
|
|
const timeFmt = "2006-01-02 15:04:05"
|
|
|
|
func now() string {
|
|
return time.Now().Format(timeFmt)
|
|
}
|