mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
15 lines
201 B
Go
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
|
|
}
|