Files
crawlab/backend/utils/user.go
yaziming ee808e0e60 refactor(all): refactor code
remove redundant code and some code refactor
2019-10-11 16:01:57 +08:00

15 lines
201 B
Go

package utils
import (
"crypto/md5"
"fmt"
"io"
)
func EncryptPassword(str string) string {
w := md5.New()
_, _ = io.WriteString(w, str)
md5str := fmt.Sprintf("%x", w.Sum(nil))
return md5str
}