From 4e55fa8ebeb741dbabda1af6452bf6e0056f6a46 Mon Sep 17 00:00:00 2001 From: Stephen McQuay Date: Fri, 15 Nov 2013 23:20:22 -0800 Subject: [PATCH] trim the hashes I tried taking it down to 6, but it fails the tests consistently ... --- id.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/id.go b/id.go index 8e549bc..0b338fb 100644 --- a/id.go +++ b/id.go @@ -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] }