From ce7e87f290875b8257ea228d934197baf62fb6bd Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 7 Nov 2013 10:01:36 -0500 Subject: [PATCH] shorten the hash --- hash/hash.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hash/hash.go b/hash/hash.go index 1c1c4d4..1c7efe8 100644 --- a/hash/hash.go +++ b/hash/hash.go @@ -37,6 +37,6 @@ func GetMd5FromBytes(blob []byte) (sum []byte) { /* get a small, decently unique hash */ func GetSmallHash() (small_hash string) { h := sha256.New() - io.WriteString(h, fmt.Sprintf("%d%d", time.Now().UnixNano(), Rand64())) - return strings.ToLower(fmt.Sprintf("%X", h.Sum(nil)[0:9])) + io.WriteString(h, fmt.Sprintf("%d%d", Rand64())) + return strings.ToLower(fmt.Sprintf("%X", h.Sum(nil)[0:4])) }