File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ package generator
44import (
55 "crypto/md5"
66 "crypto/sha1"
7+ "crypto/sha256"
78 "crypto/x509"
89 "encoding/json"
910 "encoding/pem"
@@ -35,6 +36,7 @@ specifically, section 10.2.3 ("Information Requirements").`
3536type Sum struct {
3637 MD5 string `json:"md5"`
3738 SHA1 string `json:"sha-1"`
39+ SHA256 string `json:"sha-256"`
3840}
3941
4042// Validator is a type of function that contains the logic for validating
@@ -97,8 +99,10 @@ func computeSum(in []byte) (sum Sum, err error) {
9799
98100 md5Sum := md5 .Sum (data )
99101 sha1Sum := sha1 .Sum (data )
102+ sha256Sum := sha256 .Sum256 (data )
100103 sum .MD5 = fmt .Sprintf ("%X" , md5Sum [:])
101104 sum .SHA1 = fmt .Sprintf ("%X" , sha1Sum [:])
105+ sum .SHA256 = fmt .Sprintf ("%X" , sha256Sum [:])
102106 return
103107}
104108
You can’t perform that action at this time.
0 commit comments