Some linting fixes

This commit is contained in:
2022-02-19 21:53:30 +00:00
parent 1a19d3a197
commit 02ba80a555
6 changed files with 17 additions and 19 deletions

View File

@ -6,17 +6,17 @@ import (
"golang.org/x/crypto/bcrypt"
)
// Verifier verifys passwords using Bcrypt
// Verifier verifys passwords using Bcrypt.
type Verifier struct {
cost int
}
// Verify verifys a Password
func (bv *Verifier) Verify(password string, hashOnDb string) error {
return bcrypt.CompareHashAndPassword([]byte(hashOnDb), []byte(password))
// Verify verifys a Password.
func (bv *Verifier) Verify(password string, hashOnDB string) error {
return bcrypt.CompareHashAndPassword([]byte(hashOnDB), []byte(password))
}
// Hash calculates a hash to be stored on the database
// 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)
if err != nil {