2020-04-04 21:39:27 +08:00
|
|
|
package utils
|
2019-09-02 00:19:15 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto/md5"
|
|
|
|
"encoding/hex"
|
|
|
|
)
|
|
|
|
|
2020-11-21 11:07:05 +08:00
|
|
|
//@author: [piexlmax](https://github.com/piexlmax)
|
|
|
|
//@function: MD5V
|
|
|
|
//@description: md5加密
|
|
|
|
//@param: str []byte
|
|
|
|
//@return: string
|
|
|
|
|
2021-09-15 18:42:17 +08:00
|
|
|
func MD5V(str []byte, b ...byte) string {
|
2019-09-02 00:19:15 +08:00
|
|
|
h := md5.New()
|
2020-01-21 17:17:34 +08:00
|
|
|
h.Write(str)
|
2021-09-15 18:42:17 +08:00
|
|
|
return hex.EncodeToString(h.Sum(b))
|
2019-09-02 00:19:15 +08:00
|
|
|
}
|