github.com/pavlo67/common@v0.5.3/common/encrlib/types.go (about) 1 package encrlib 2 3 import ( 4 "errors" 5 ) 6 7 var ErrBadCryptype = errors.New("bad cryptography type") 8 9 type Cryptype string 10 11 const ( 12 SHA256 Cryptype = "SHA256" 13 Provos Cryptype = "Provos" 14 NoCrypt Cryptype = "" 15 ) 16 17 //const CryptypePreferred Cryptype = SHA256 18 19 //func PasswordValidation(password string, minLength int) (string, error) { 20 // password = strings.TrimSpace(password) 21 // 22 // if minLength > 0 && len(password) < minLength { 23 // return "", fmt.Errorf("закороткий пароль, повинно бути не менше %d символів", minLength) 24 // } 25 // return password, nil 26 //}