Skip to content

Commit

Permalink
Initializing random seed
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Aug 3, 2015
1 parent a6a0ed3 commit edb93a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions anonuuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"math/rand"
"regexp"
"strings"
"time"
)

var (
Expand Down Expand Up @@ -62,6 +63,10 @@ func New() *AnonUUID {
}
}

func init() {
rand.Seed(time.Now().UTC().UnixNano())
}

// FormatUUID takes a string in input and return an UUID formatted string by repeating the string and placing dashes if necessary
func FormatUUID(part string) string {
if len(part) < 32 {
Expand Down

0 comments on commit edb93a3

Please sign in to comment.