Skip to content

Instantly share code, notes, and snippets.

@jgrahamc
Created July 3, 2012 13:51
Show Gist options
  • Save jgrahamc/3039800 to your computer and use it in GitHub Desktop.
Save jgrahamc/3039800 to your computer and use it in GitHub Desktop.
Unique ID generator
id := make(chan string)
go func() {
h := sha1.New()
c := []byte(time.Now().String())
for {
h.Write(c)
id <- fmt.Sprintf("%x", h.Sum(nil))
}
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment