Documentation
¶
Overview ¶
module designed to define a BCrypt hasher that can be used with the Osgood File Server's Authenticators. this will fit the Hasher interface defined in ofsauthenticators/interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BCryptHasher ¶
type BCryptHasher struct {
// contains filtered or unexported fields
}
func NewBCryptHasher ¶
func NewBCryptHasher(opts ...BCryptHasherOptFunc) (hasher *BCryptHasher, err error)
function designed to create, initialize and return a BCryptHasher object.
func (*BCryptHasher) ComparePassHash ¶
func (bch *BCryptHasher) ComparePassHash(password []byte, hash []byte) error
function designed to take in a password and hash and compare the two.
if the password and hash match, nil will be returned.
func (*BCryptHasher) HashPassword ¶
func (bch *BCryptHasher) HashPassword(password []byte) (hash []byte, err error)
function designed to calculate and return the hash of a given password.
type BCryptHasherOptFunc ¶
type BCryptHasherOptFunc func(*BCryptHasherOption) error
type BCryptHasherOption ¶
type BCryptHasherOption struct {
Cost int
}
Click to show internal directories.
Click to hide internal directories.