Guest User

Untitled

a guest
Jun 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. func (ctl *AppEndpoint) GenerateGlobalID(data interface{}) string {
  2. dataBytes := []byte(fmt.Sprintf("%v", data))
  3. timeBytes := []byte(fmt.Sprintf("%v", time.Now()))
  4.  
  5. bytes := append(dataBytes, timeBytes…)
  6. bytes = []byte(fmt.Sprintf("%x", md5.Sum(bytes)))
  7. ctl.GlobalID = string(bytes)
  8. return ctl.GlobalID
  9. }
Add Comment
Please, Sign In to add comment