Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Letters = []rune(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`) Numbers = []rune(`0123456789`) SpecialCharacters = []rune(`$&*()%_+!@#=-][}{,.><;:\/?|`) SpecialCharAndNumbers = append(Numbers, SpecialCharacters...) SpecialCharAndLetters = append(Letters, SpecialCharacters...) LettersAndNumbers = append(Numbers, Letters...) AllCharacters = append(SpecialCharAndLetters, Numbers...) )
View Source
var ( RegexNumbers = `[0-9]+` RegexLetters = `[a-zA-Z]+` RegexEspecialChar = `[^0-9a-zA-Z *]` RegexAsterisk = `[*]` )
Functions ¶
This section is empty.
Types ¶
type PasswordGen ¶
type PasswordGen struct { Uuid string `json:"uuid"` Password string `json:"password"` Length int `json:"length"` HasLetter bool `json:"has_letter"` HasNumber bool `json:"has_number"` HasSpecialChar bool `json:"has_special_char"` }
func NewPasswordGen ¶
func NewPasswordGen(uuid string, password string, length int, hasLetter, hasNumber, hasSpecialChar bool) *PasswordGen
func (*PasswordGen) GetPasswordLetters ¶
func (p *PasswordGen) GetPasswordLetters(password string) []string
func (*PasswordGen) GetPasswordNumbers ¶
func (p *PasswordGen) GetPasswordNumbers(password string) []string
func (*PasswordGen) GetPasswordSpecialChars ¶
func (p *PasswordGen) GetPasswordSpecialChars(password string) []string
func (*PasswordGen) Validate ¶
func (p *PasswordGen) Validate(body []byte) error
Click to show internal directories.
Click to hide internal directories.