We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ebe0199 commit 6f10f22Copy full SHA for 6f10f22
1 file changed
api/generator/generator.go
@@ -4,6 +4,7 @@ package generator
4
import (
5
"crypto/md5"
6
"crypto/sha1"
7
+ "crypto/sha256"
8
"crypto/x509"
9
"encoding/json"
10
"encoding/pem"
@@ -35,6 +36,7 @@ specifically, section 10.2.3 ("Information Requirements").`
35
36
type Sum struct {
37
MD5 string `json:"md5"`
38
SHA1 string `json:"sha-1"`
39
+ SHA256 string `json:"sha-256"`
40
}
41
42
// Validator is a type of function that contains the logic for validating
@@ -97,8 +99,10 @@ func computeSum(in []byte) (sum Sum, err error) {
97
99
98
100
md5Sum := md5.Sum(data)
101
sha1Sum := sha1.Sum(data)
102
+ sha256Sum := sha256.Sum256(data)
103
sum.MD5 = fmt.Sprintf("%X", md5Sum[:])
104
sum.SHA1 = fmt.Sprintf("%X", sha1Sum[:])
105
+ sum.SHA256 = fmt.Sprintf("%X", sha256Sum[:])
106
return
107
108
0 commit comments