new start

This commit is contained in:
2026-03-22 14:26:49 +01:00
parent da5f87d67b
commit d756023952
11 changed files with 242 additions and 237 deletions
+13
View File
@@ -0,0 +1,13 @@
package main
import "golang.org/x/crypto/bcrypt"
func PasswordHash(password string) (string, error) {
bytes, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
return string(bytes), err
}
func PasswordCheckAgainstHash(password, hash string) bool {
err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))
return err == nil
}