MCPcopy
hub / github.com/gtank/cryptopasta / HashPassword

Function HashPassword

hash.go:41–43  ·  view source on GitHub ↗

HashPassword generates a bcrypt hash of the password using work factor 14.

(password []byte)

Source from the content-addressed store, hash-verified

39
40// HashPassword generates a bcrypt hash of the password using work factor 14.
41func HashPassword(password []byte) ([]byte, error) {
42 return bcrypt.GenerateFromPassword(password, 14)
43}
44
45// CheckPassword securely compares a bcrypt hashed password with its possible
46// plaintext equivalent. Returns nil on success, or an error on failure.

Callers 2

TestPasswordHashingFunction · 0.85
BenchmarkBcryptFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestPasswordHashingFunction · 0.68
BenchmarkBcryptFunction · 0.68