File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,10 @@ func (d DefinitionData) schemaDefinitionLoader() util.Loader[crdSchemas] {
48
48
49
49
func (d DefinitionData ) Checksum () (definition , schema string ) {
50
50
if len (d .definition ) > 0 {
51
- definition = util .SHA256 (d .definition )
51
+ definition = util .MD5 (d .definition )
52
52
}
53
53
if len (d .schemaDefinition ) > 0 {
54
- schema = util .SHA256 (d .schemaDefinition )
54
+ schema = util .MD5 (d .schemaDefinition )
55
55
}
56
56
return
57
57
}
Original file line number Diff line number Diff line change 21
21
package util
22
22
23
23
import (
24
+ "crypto/md5"
24
25
"crypto/sha256"
25
26
"fmt"
26
27
@@ -35,6 +36,14 @@ func SHA256(data []byte) string {
35
36
return fmt .Sprintf ("%0x" , sha256 .Sum256 (data ))
36
37
}
37
38
39
+ func MD5FromString (data string ) string {
40
+ return MD5 ([]byte (data ))
41
+ }
42
+
43
+ func MD5 (data []byte ) string {
44
+ return fmt .Sprintf ("%0x" , md5 .Sum (data ))
45
+ }
46
+
38
47
func SHA256FromJSON [T interface {}](a T ) (string , error ) {
39
48
d , err := json .Marshal (a )
40
49
if err != nil {
You can’t perform that action at this time.
0 commit comments