Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCompareFailed = errors.New("crypt compare failed")
ErrCompareFailed compare failed
Functions ¶
func IsComplexEnough ¶
IsComplexEnough return True if password meets complexity settings
func SetupComplexity ¶
func SetupComplexity(values []string)
SetupComplexity setup complexity with values value can set lower,upper,digit,spec default use lower, upper and digit to generate a random password, and not meets complexity.
Types ¶
type BCrypt ¶
type BCrypt struct{}
BCrypt bcrypt password encryption
func (BCrypt) CompareHashAndPassword ¶ added in v0.4.0
CompareHashAndPassword password hash verification
type Crypt ¶ added in v0.4.0
type Crypt interface { GenerateFromPassword(password string) (string, error) CompareHashAndPassword(hashedPassword, password string) error }
Crypt crypt interface
type SCrypt ¶
type SCrypt struct{}
SCrypt scrypt password encryption
func (SCrypt) CompareHashAndPassword ¶ added in v0.4.0
CompareHashAndPassword password hash verification
type Simple ¶
type Simple struct{}
Simple simple password encryption
func (Simple) CompareHashAndPassword ¶ added in v0.4.0
Compare password hash verification
Click to show internal directories.
Click to hide internal directories.