MCPcopy
hub / github.com/perkeep/perkeep / RefFromBytes

Function RefFromBytes

pkg/blob/ref.go:440–444  ·  view source on GitHub ↗

RefFromBytes returns a blobref from the given string, for the currently recommended hash function.

(b []byte)

Source from the content-addressed store, hash-verified

438// RefFromBytes returns a blobref from the given string, for the currently
439// recommended hash function.
440func RefFromBytes(b []byte) Ref {
441 h := NewHash()
442 h.Write(b)
443 return RefFromHash(h)
444}
445
446type sha1Digest [20]byte
447

Callers 7

TestReceiveFunction · 0.92
TestReceiveCorruptFunction · 0.92
ReceiveBlobMethod · 0.92
makePackedMetaBlobMethod · 0.92
writeAZipMethod · 0.92
writeToCacheFunction · 0.92
hourlyCompareMethod · 0.92

Calls 3

NewHashFunction · 0.85
RefFromHashFunction · 0.85
WriteMethod · 0.45

Tested by 2

TestReceiveFunction · 0.74
TestReceiveCorruptFunction · 0.74