Browse Source

trim the hashes

I tried taking it down to 6, but it fails the tests consistently ...
master
Stephen McQuay 7 years ago
parent
commit
4e55fa8ebe
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      id.go

+ 1
- 1
id.go View File

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

Loading…
Cancel
Save