MCPcopy
hub / github.com/perkeep/perkeep / HashMatches

Method HashMatches

pkg/blob/ref.go:187–192  ·  view source on GitHub ↗
(h hash.Hash)

Source from the content-addressed store, hash-verified

185}
186
187func (r Ref) HashMatches(h hash.Hash) bool {
188 if r.digest == nil {
189 return false
190 }
191 return bytes.Equal(h.Sum(nil), r.digest.bytes())
192}
193
194const hexDigit = "0123456789abcdef"
195

Callers 14

ValidContentsMethod · 0.45
HashMatchesMethod · 0.45
ReadMethod · 0.45
verifySizeAndHashFunction · 0.45
ReceiveBlobMethod · 0.45
ReceiveBlobMethod · 0.45
FetchMethod · 0.45
TestReindexFunction · 0.45
testPackFunction · 0.45
TestForeachZipBlobFunction · 0.45
copyBlobMethod · 0.45
hourlyCompareMethod · 0.45

Calls 3

EqualMethod · 0.80
SumMethod · 0.80
bytesMethod · 0.65

Tested by 4

verifySizeAndHashFunction · 0.36
TestReindexFunction · 0.36
testPackFunction · 0.36
TestForeachZipBlobFunction · 0.36