layout corporate, navbar & side bar templ
This commit is contained in:
16
utils/generaterandomid.utils.go
Normal file
16
utils/generaterandomid.utils.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func GenerateRandomID(text string) string {
|
||||
seed := text + time.Now().String()
|
||||
hash := md5.Sum([]byte(seed))
|
||||
randomID := hex.EncodeToString(hash[:])
|
||||
randomID = strings.ReplaceAll(randomID, "-", "")
|
||||
return randomID
|
||||
}
|
||||
Reference in New Issue
Block a user