budgeteer/bcrypt/verifier.go
2016-12-20 15:15:33 +01:00

16 lines
326 B
Go

package bcrypt
import (
"golang.org/x/crypto/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))
}