1
This commit is contained in:
17
pkg/cryptohelper/md5helper/md5helper.go
Normal file
17
pkg/cryptohelper/md5helper/md5helper.go
Normal file
@ -0,0 +1,17 @@
|
||||
package md5helper
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
)
|
||||
|
||||
// MD5 md5加密
|
||||
func MD5(input string) string {
|
||||
cc := md5.Sum([]byte(input))
|
||||
return hex.EncodeToString(cc[:])
|
||||
}
|
||||
|
||||
// MD52 md52次
|
||||
func MD52(input string) string {
|
||||
return MD5(MD5(input))
|
||||
}
|
||||
Reference in New Issue
Block a user