MCPcopy
hub / github.com/filebrowser/filebrowser / CheckPwd

Function CheckPwd

users/password.go:32–35  ·  view source on GitHub ↗

CheckPwd checks if a password is correct.

(password, hash string)

Source from the content-addressed store, hash-verified

30
31// CheckPwd checks if a password is correct.
32func CheckPwd(password, hash string) bool {
33 err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))
34 return err == nil
35}
36
37func RandomPwd(passwordLength uint) (string, error) {
38 randomPasswordBytes := make([]byte, passwordLength)

Callers 4

users.goFile · 0.92
AuthMethod · 0.92
SaveUserMethod · 0.92
AuthMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected