16 lines
326 B
Go
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))
|
|
}
|