Skip to content

Commit

Permalink
fixing random seed - still can be better
Browse files Browse the repository at this point in the history
  • Loading branch information
xmjw committed Jul 11, 2015
1 parent a71a20d commit c0bd1cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api.go
Expand Up @@ -106,9 +106,10 @@ const charabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz

// Generates 8 x alphachar string as a unique ID.
func createId() string {
r := rand.New(rand.NewSource(time.Now().UnixNano()))
var bytes = make([]byte, 8)
for k, _ := range bytes {
bytes[k] = charabet[rand.Intn(len(charabet))]
bytes[k] = charabet[r.Intn(len(charabet))]
}
return string(bytes)
}
Expand Down

0 comments on commit c0bd1cb

Please sign in to comment.