Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMaxLengthExceeded is returned when the sum of minimum character lengths exceeded maximum length ErrMaxLengthExceeded = errors.New("sum of minimum character lengths exceeded maximum password length") )
Functions ¶
func CreateRandom ¶
CreateRandom returns a random byte string of given length from given byte string
Types ¶
type Policy ¶
type Policy struct { MinLength int // Minimum length of password MaxLength int // Maximum length of password MinLowers int // Minimum length of lower case letters MinUppers int // Minimum length of upper case letters MinDigits int // Minimum length of digits MinSpclChars int // Minimum length of special characters LowerPool string // Permitted upper case letters UpperPool string // Permitted lower case letters DigitPool string // Permitted digits SpclCharPool string // Permitted special characters }
Policy of password to be passed in Generate() function
Click to show internal directories.
Click to hide internal directories.