Files
crawlab/backend/utils/user.go
2019-07-26 23:02:30 +08:00

15 lines
194 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
}