trim the hashes
I tried taking it down to 6, but it fails the tests consistently ...
This commit is contained in:
parent
f8fb523a76
commit
4e55fa8ebe
2
id.go
2
id.go
@ -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]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user