Skip to content

Commit 40d0494

Browse files
authored
Change hash function from SHA1 to SHA256
FIP-140 mandates a move away from SHA1
1 parent a826b32 commit 40d0494

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

redis/redis.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package redis
22

33
import (
44
"context"
5-
"crypto/sha1"
5+
"crypto/sha256"
66
"encoding/hex"
77
"io"
88
"time"
@@ -38,7 +38,7 @@ type Script struct {
3838
// SendHash methods.
3939
// Taken from https://github.com/gomodule/redigo/blob/46992b0f02f74066bcdfd9b03e33bc03abd10dc7/redis/script.go#L32-L41
4040
func NewScript(keyCount int, src string) *Script {
41-
h := sha1.New()
41+
h := sha256.New()
4242
_, _ = io.WriteString(h, src)
4343
return &Script{keyCount, src, hex.EncodeToString(h.Sum(nil))}
4444
}

0 commit comments

Comments
 (0)