started working on the backend

This commit is contained in:
z1glr
2025-01-07 16:37:37 +00:00
parent 03b2b0e206
commit c3bc06fe82
34 changed files with 1437 additions and 54 deletions

View File

@@ -0,0 +1,13 @@
package router
import "golang.org/x/crypto/bcrypt"
// hashes a password
func hashPassword(password string) ([]byte, error) {
return bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
}
// validates a password against the password-rules
func validatePassword(password string) bool {
return len(password) >= 12 && len(password) <= 64
}