MCPcopy Index your code
hub / github.com/kopia/kopia / oidForContent

Function oidForContent

internal/diff/diff_test.go:603–615  ·  view source on GitHub ↗
(t *testing.T, prefix content.IDPrefix, c []byte)

Source from the content-addressed store, hash-verified

601}
602
603func oidForContent(t *testing.T, prefix content.IDPrefix, c []byte) object.ID {
604 t.Helper()
605
606 h := blake3.New()
607 _, err := h.Write(c)
608
609 require.NoError(t, err)
610
611 cid, err := content.IDFromHash(prefix, h.Sum(nil))
612 require.NoError(t, err)
613
614 return object.DirectObjectID(cid)
615}

Callers 1

oidForStringFunction · 0.85

Calls 4

IDFromHashFunction · 0.92
DirectObjectIDFunction · 0.92
HelperMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected