MCPcopy
hub / github.com/gotify/server / CreatePassword

Function CreatePassword

auth/password/password.go:6–12  ·  view source on GitHub ↗

CreatePassword returns a hashed version of the given password.

(pw string, strength int)

Source from the content-addressed store, hash-verified

4
5// CreatePassword returns a hashed version of the given password.
6func CreatePassword(pw string, strength int) []byte {
7 hashedPassword, err := bcrypt.GenerateFromPassword([]byte(pw), strength)
8 if err != nil {
9 panic(err)
10 }
11 return hashedPassword
12}
13
14// ComparePassword compares a hashed password with its possible plaintext equivalent.
15func ComparePassword(hashedPassword, password []byte) bool {

Callers 12

NewFunction · 0.92
SetupSuiteMethod · 0.92
Test_UpdatePasswordMethod · 0.92
CreateUserMethod · 0.92
ChangePasswordMethod · 0.92
UpdateUserByIDMethod · 0.92
TestPasswordSuccessFunction · 0.85
TestPasswordFailureFunction · 0.85
TestBCryptFailureFunction · 0.85

Calls

no outgoing calls

Tested by 8

SetupSuiteMethod · 0.74
Test_UpdatePasswordMethod · 0.74
TestPasswordSuccessFunction · 0.68
TestPasswordFailureFunction · 0.68
TestBCryptFailureFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…