Documentation
¶
Index ¶
- Constants
- Variables
- func Argon2ID(password string) (hash string)
- func Argon2IDComparePasswordAndHash(password, hash string) (match bool, err error)
- func CheckPasswordHash(password, hash string) bool
- func HashPassword(password string) (string, error)
- func Validate(password, passwordConfirm string) error
- type MismatchError
- type Params
- type ValidationError
Constants ¶
View Source
const ( PassField = "password" PassMinLength = 8 PassMaxLength = 32 EntropyMinForPassword = 70 BCryptCost = 13 )
View Source
const (
SaltLength = 16
)
Variables ¶
View Source
var ( ErrInvalidHash = errors.New("argon2id: hash is not in the correct format") ErrIncompatibleVariant = errors.New("argon2id: incompatible variant of argon2") ErrIncompatibleVersion = errors.New("argon2id: incompatible version of argon2") DefaultParams = &Params{ Memory: memoryLimit, Iterations: 4, Parallelism: 4, SaltLength: SaltLength, KeyLength: 32, } )
Functions ¶
func CheckPasswordHash ¶
func HashPassword ¶
Types ¶
type MismatchError ¶
type MismatchError struct {
// contains filtered or unexported fields
}
func (MismatchError) Error ¶
func (m MismatchError) Error() string
type Params ¶
type ValidationError ¶
func (*ValidationError) Error ¶
func (ve *ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.