mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-19 20:26:26 +08:00
19 lines
289 B
Go
19 lines
289 B
Go
![]() |
package utils
|
||
|
|
||
|
import (
|
||
|
"crypto/md5"
|
||
|
"encoding/hex"
|
||
|
)
|
||
|
|
||
|
// GetMD5Encode
|
||
|
func GetMD5Encode(data string) string {
|
||
|
h := md5.New()
|
||
|
h.Write([]byte(data))
|
||
|
return hex.EncodeToString(h.Sum(nil))
|
||
|
}
|
||
|
|
||
|
// Get16MD5Encode
|
||
|
func Get16MD5Encode(data string) string {
|
||
|
return GetMD5Encode(data)[8:24]
|
||
|
}
|