MCPcopy Index your code
hub / github.com/apache/answer / encryptPassword

Method encryptPassword

internal/service/content/user_service.go:649–653  ·  view source on GitHub ↗

encryptPassword The password does irreversible encryption.

(_ context.Context, pass string)

Source from the content-addressed store, hash-verified

647// encryptPassword
648// The password does irreversible encryption.
649func (us *UserService) encryptPassword(_ context.Context, pass string) (string, error) {
650 hashPwd, err := bcrypt.GenerateFromPassword([]byte(pass), bcrypt.DefaultCost)
651 // This encrypted string can be saved to the database and can be used as password matching verification
652 return string(hashPwd), err
653}
654
655// UserChangeEmailSendCode user change email verification
656func (us *UserService) UserChangeEmailSendCode(ctx context.Context, req *schema.UserChangeEmailSendCodeReq) (

Callers 3

UserModifyPasswordMethod · 0.95
UserRegisterByEmailMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected