Fix semgrep use-of-weak-crypto error (#15784)

Signed-off-by: Soumik Majumder <soumikm@vmware.com>
This commit is contained in:
Soumik Majumder 2021-10-14 11:58:59 +05:30 committed by GitHub
parent 7fc22e4344
commit 2679b2427b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,7 @@
package redis
import (
"crypto/md5"
"crypto/sha256"
"fmt"
"time"
@ -107,7 +107,7 @@ func New(opts cache.Options) (cache.Cache, error) {
opts.Address = "redis://localhost:6379/0"
}
name := fmt.Sprintf("%x", md5.Sum([]byte(opts.Address)))
name := fmt.Sprintf("%x", sha256.Sum256([]byte(opts.Address)))
param := &libredis.PoolParam{
PoolMaxIdle: 100,