MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / HashPassword

Method HashPassword

internal/domain/user.go:95–102  ·  view source on GitHub ↗

HashPassword 对密码进行哈希处理

()

Source from the content-addressed store, hash-verified

93
94// HashPassword 对密码进行哈希处理
95func (u *User) HashPassword() error {
96 hash, err := bcrypt.GenerateFromPassword([]byte(u.Password), bcrypt.DefaultCost)
97 if err != nil {
98 return err
99 }
100 u.Password = string(hash)
101 return nil
102}
103
104// UpdateProfile 更新用户资料
105func (u *User) UpdateProfile(newProfile Profile) {

Callers 1

SignUpMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected