trim the hashes

I tried taking it down to 6, but it fails the tests consistently ...
This commit is contained in:
Stephen McQuay 2013-11-15 23:20:22 -08:00
parent f8fb523a76
commit 4e55fa8ebe

2
id.go
View File

@ -33,5 +33,5 @@ func (id *IdGenerator) Hash() string {
h := md5.New() h := md5.New()
ns := time.Now().UnixNano() + <-id.id ns := time.Now().UnixNano() + <-id.id
io.WriteString(h, fmt.Sprintf("%d", ns)) io.WriteString(h, fmt.Sprintf("%d", ns))
return fmt.Sprintf("%x", h.Sum(nil)) return fmt.Sprintf("%x", h.Sum(nil))[:8]
} }