13 lines
250 B
Go
13 lines
250 B
Go
package cryptoutil
|
|
|
|
import (
|
|
"crypto/md5"
|
|
"encoding/hex"
|
|
)
|
|
|
|
// MD5 对输入字符串进行 MD5 加密,返回 32 位小写十六进制字符串
|
|
func MD5(input string) string {
|
|
hash := md5.Sum([]byte(input))
|
|
return hex.EncodeToString(hash[:])
|
|
}
|