MCPcopy
hub / github.com/filebrowser/filebrowser / ValidateAndHashPwd

Function ValidateAndHashPwd

users/password.go:13–23  ·  view source on GitHub ↗

ValidateAndHashPwd validates and hashes a password.

(password string, minimumLength uint)

Source from the content-addressed store, hash-verified

11
12// ValidateAndHashPwd validates and hashes a password.
13func ValidateAndHashPwd(password string, minimumLength uint) (string, error) {
14 if uint(len(password)) < minimumLength {
15 return "", fberrors.ErrShortPassword{MinimumLength: minimumLength}
16 }
17
18 if _, ok := commonPasswords[password]; ok {
19 return "", fberrors.ErrEasyPassword
20 }
21
22 return HashPwd(password)
23}
24
25// HashPwd hashes a password.
26func HashPwd(password string) (string, error) {

Callers 7

users.goFile · 0.92
auth.goFile · 0.92
createUserMethod · 0.92
SaveUserMethod · 0.92
quickSetupFunction · 0.92
users_add.goFile · 0.92
users_update.goFile · 0.92

Calls 1

HashPwdFunction · 0.85

Tested by

no test coverage detected