MCPcopy
hub / github.com/superplanehq/superplane / HashPassword

Function HashPassword

pkg/crypto/password.go:10–16  ·  view source on GitHub ↗

HashPassword hashes a plaintext password using bcrypt

(password string)

Source from the content-addressed store, hash-verified

8
9// HashPassword hashes a plaintext password using bcrypt
10func HashPassword(password string) (string, error) {
11 hash, err := bcrypt.GenerateFromPassword([]byte(password), bcryptCost)
12 if err != nil {
13 return "", err
14 }
15 return string(hash), nil
16}
17
18// VerifyPassword verifies a plaintext password against a bcrypt hash
19func VerifyPassword(hash, password string) bool {

Callers 5

setupOwnerMethod · 0.92
changePasswordMethod · 0.92
handlePasswordSignupMethod · 0.92

Calls

no outgoing calls