Created
July 3, 2012 13:51
-
-
Save jgrahamc/3039800 to your computer and use it in GitHub Desktop.
Unique ID generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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