start minIO, refactored files into packages

This commit is contained in:
2026-04-13 20:22:38 +02:00
parent 6435206683
commit c90c13b468
22 changed files with 311 additions and 218 deletions
+13
View File
@@ -0,0 +1,13 @@
package passwords
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
}