MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / Password2Hash

Function Password2Hash

common/crypto.go:22–26  ·  view source on GitHub ↗
(password string)

Source from the content-addressed store, hash-verified

20}
21
22func Password2Hash(password string) (string, error) {
23 passwordBytes := []byte(password)
24 hashedPassword, err := bcrypt.GenerateFromPassword(passwordBytes, bcrypt.DefaultCost)
25 return string(hashedPassword), err
26}
27
28func ValidatePasswordAndHash(password string, hash string) bool {
29 err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))

Callers 6

PostSetupFunction · 0.92
InsertMethod · 0.92
UpdateMethod · 0.92
EditMethod · 0.92
ResetUserPasswordByEmailFunction · 0.92
createRootAccountIfNeedFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected