add some utils
This commit is contained in:
12
utils/hash/md5.go
Normal file
12
utils/hash/md5.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package hash
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
)
|
||||
|
||||
func MD5(str []byte, b ...byte) string {
|
||||
h := md5.New()
|
||||
h.Write(str)
|
||||
return hex.EncodeToString(h.Sum(b))
|
||||
}
|
||||
Reference in New Issue
Block a user