File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import (
3030//
3131// The following is an example of the contents of Digest types:
3232//
33- // sha256:7173b809ca12ec5dee4506cd86be934c4596dd234ee82c0662eac04a8c2c71dc
33+ // sha256:7173b809ca12ec5dee4506cd86be934c4596dd234ee82c0662eac04a8c2c71dc
3434//
3535// This allows to abstract the digest behind this type and work only in those
3636// terms.
@@ -146,6 +146,16 @@ func (d Digest) String() string {
146146 return string (d )
147147}
148148
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+
149159func (d Digest ) sepIndex () int {
150160 i := strings .Index (string (d ), ":" )
151161
You can’t perform that action at this time.
0 commit comments