mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-29 14:41:09 +01:00
Switch physical cache map index value to md5 from sha1 for all the performances
This commit is contained in:
parent
3445b3ae63
commit
c2bd662386
@ -1,7 +1,7 @@
|
|||||||
package physical
|
package physical
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/sha1"
|
"crypto/md5"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
@ -59,7 +59,7 @@ func NewCache(b Backend, size int, logger log.Logger) *Cache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Cache) lockHashForKey(key string) string {
|
func (c *Cache) lockHashForKey(key string) string {
|
||||||
hf := sha1.New()
|
hf := md5.New()
|
||||||
hf.Write([]byte(key))
|
hf.Write([]byte(key))
|
||||||
return strings.ToLower(hex.EncodeToString(hf.Sum(nil))[:2])
|
return strings.ToLower(hex.EncodeToString(hf.Sum(nil))[:2])
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user