Switch physical cache map index value to md5 from sha1 for all the performances

This commit is contained in:
Jeff Mitchell 2017-03-06 13:11:14 -05:00
parent 412aad7c6e
commit f5ffa229f4
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
package physical
import (
"crypto/sha1"
"crypto/md5"
"encoding/hex"
"fmt"
"strings"
@ -59,7 +59,7 @@ func NewCache(b Backend, size int, logger log.Logger) *Cache {
}
func (c *Cache) lockHashForKey(key string) string {
hf := sha1.New()
hf := md5.New()
hf.Write([]byte(key))
return strings.ToLower(hex.EncodeToString(hf.Sum(nil))[:2])
}