Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func (ctl *AppEndpoint) GenerateGlobalID(data interface{}) string {
- dataBytes := []byte(fmt.Sprintf("%v", data))
- timeBytes := []byte(fmt.Sprintf("%v", time.Now()))
- bytes := append(dataBytes, timeBytes…)
- bytes = []byte(fmt.Sprintf("%x", md5.Sum(bytes)))
- ctl.GlobalID = string(bytes)
- return ctl.GlobalID
- }
Add Comment
Please, Sign In to add comment