From b52ed21d1d51214f81465250554ecf3c1c1a2c1a Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Sun, 20 Feb 2022 20:42:07 +0000 Subject: [PATCH] Remove cost and just use defaultCost --- bcrypt/verifier.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bcrypt/verifier.go b/bcrypt/verifier.go index f52a3b8..22dc5bc 100644 --- a/bcrypt/verifier.go +++ b/bcrypt/verifier.go @@ -7,9 +7,7 @@ import ( ) // Verifier verifys passwords using Bcrypt. -type Verifier struct { - cost int -} +type Verifier struct{} // Verify verifys a Password. func (bv *Verifier) Verify(password string, hashOnDB string) error { @@ -23,7 +21,7 @@ func (bv *Verifier) Verify(password string, hashOnDB string) error { // Hash calculates a hash to be stored on the database. func (bv *Verifier) Hash(password string) (string, error) { - hash, err := bcrypt.GenerateFromPassword([]byte(password), bv.cost) + hash, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) if err != nil { return "", fmt.Errorf("hash password: %w", err) }