Initial commit

This commit is contained in:
2026-02-20 23:28:42 +01:00
commit 02b494a221
16 changed files with 234 additions and 0 deletions

20
utils/util.go Normal file
View File

@@ -0,0 +1,20 @@
package utils
import (
"github.com/google/uuid"
"golang.org/x/crypto/bcrypt"
)
func HashPassword(password string) (string, error) {
bytes, err := bcrypt.GenerateFromPassword([]byte(password), 14)
return string(bytes), err
}
func CheckPasswordHash(password, hash string) bool {
err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))
return err == nil
}
func GenerateUUID() string {
return uuid.New().String()
}