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 @@ -140,11 +140,21 @@ func (d Digest) Encoded() string {
140140 return string (d [d .sepIndex ()+ 1 :])
141141}
142142
143- // Hex is deprecated. Please use Digest.Encoded.
143+ // IsIdenticalTo compares this digest to any other, inclusive of the hashing algorithm used
144+ func (d Digest ) IsIdenticalTo (o Digest ) bool {
145+ return string (d ) == string (o )
146+ }
147+
148+ // Deprecated: Hex has been deprecated in favor of Digest.Encoded
144149func (d Digest ) Hex () string {
145150 return d .Encoded ()
146151}
147152
153+ // IsEmpty does what it says (an empty digest is an empty string)
154+ func (d Digest ) IsEmpty () bool {
155+ return len (d .String ()) == 0
156+ }
157+
148158func (d Digest ) String () string {
149159 return string (d )
150160}
You can’t perform that action at this time.
0 commit comments