File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import (
30
30
//
31
31
// The following is an example of the contents of Digest types:
32
32
//
33
- // sha256:7173b809ca12ec5dee4506cd86be934c4596dd234ee82c0662eac04a8c2c71dc
33
+ // sha256:7173b809ca12ec5dee4506cd86be934c4596dd234ee82c0662eac04a8c2c71dc
34
34
//
35
35
// This allows to abstract the digest behind this type and work only in those
36
36
// terms.
@@ -146,6 +146,16 @@ func (d Digest) String() string {
146
146
return string (d )
147
147
}
148
148
149
+ // IsIdenticalTo compares this digest to any other, inclusive of the hashing algorithm used
150
+ func (d Digest ) IsIdenticalTo (o Digest ) bool {
151
+ return string (d ) == string (o )
152
+ }
153
+
154
+ // IsEmpty does what it says (an empty digest is an empty string)
155
+ func (d Digest ) IsEmpty () bool {
156
+ return len (d ) == 0
157
+ }
158
+
149
159
func (d Digest ) sepIndex () int {
150
160
i := strings .Index (string (d ), ":" )
151
161
You can’t perform that action at this time.
0 commit comments