Files
TradarrV2/backend/internal/auth/passwords.go
Blomios 1b0625f91c chore(repo): initialize Tradarr repository
Add the existing application baseline and repository documentation/ignore rules.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-20 18:38:53 +01:00

13 lines
335 B
Go

package auth
import "golang.org/x/crypto/bcrypt"
func HashPassword(password string) (string, error) {
b, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
return string(b), err
}
func CheckPassword(hash, password string) bool {
return bcrypt.CompareHashAndPassword([]byte(hash), []byte(password)) == nil
}