23 lines
359 B
Go
23 lines
359 B
Go
package utils
|
|
|
|
import (
|
|
"crypto/md5"
|
|
"encoding/hex"
|
|
"time"
|
|
)
|
|
|
|
func GenerateMD5() string {
|
|
currentTime := time.Now()
|
|
dateString := currentTime.Format("20060102")
|
|
|
|
inputString := "6tj4u" + dateString
|
|
|
|
hasher := md5.New()
|
|
hasher.Write([]byte(inputString))
|
|
hashBytes := hasher.Sum(nil)
|
|
|
|
hashString := hex.EncodeToString(hashBytes)
|
|
|
|
return hashString
|
|
}
|