Documentation
¶
Index ¶
Constants ¶
Variables ¶
View Source
var ( // ErrInvalidHash is raised when caller try to invoke not supported algorithm ErrInvalidHash = errors.New("butcher: invalid hash") // ErrStrategyNotSupported is raised when caller try to invoke not supported algorithm ErrStrategyNotSupported = errors.New("butcher: given strategy is not supported") )
View Source
var ( // DefaultSaltFunc defines the default salt generation factory to use when not specified DefaultSaltFunc = RandomNonce(32) )
Functions ¶
func FixedNonce ¶
FixedNonce returns a nonce factory that returns the given salt
func NeedsUpgrade ¶
NeedsUpgrade returns the password hash upgrade need when DefaultAlgorithm is changed
func RandomNonce ¶
RandomNonce returns a nonce factory that returns a random length bound salt
Types ¶
type Butcher ¶
type Butcher struct {
// contains filtered or unexported fields
}
Butcher defines the hasher configuration
func New ¶
New butcher instance is buildded according options
func (*Butcher) Hash ¶
Hash the given password with the hash strategy
func (*Butcher) NeedsUpgrade ¶ added in v0.0.3
NeedsUpgrade returns the password hash upgrade need when DefaultAlgorithm is changed
Click to show internal directories.
Click to hide internal directories.