Skip to content

Commit 23f9be2

Browse files
authored
Use thread safe function (#29)
1 parent db06c2d commit 23f9be2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

internal/convert/id.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ import (
55
"fmt"
66
)
77

8-
var h = sha1.New()
9-
108
// MakeId takes a byte representation of a resource and returns a stable string ID for it.
119
func MakeId(s []byte) string {
12-
h.Reset()
13-
h.Write(s)
14-
return fmt.Sprintf("%x", h.Sum(nil))
10+
return fmt.Sprintf("%x", sha1.Sum(s))
1511
}

0 commit comments

Comments
 (0)