From d18d74804611bcec0389b2a1ce1c72599bd73489 Mon Sep 17 00:00:00 2001 From: Paul Cacheux Date: Thu, 10 Oct 2024 12:07:56 +0200 Subject: [PATCH] add comment explaining the format --- pkg/security/resolvers/sbom/file_querier.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/security/resolvers/sbom/file_querier.go b/pkg/security/resolvers/sbom/file_querier.go index 548618b324140..1009c076e0ebe 100644 --- a/pkg/security/resolvers/sbom/file_querier.go +++ b/pkg/security/resolvers/sbom/file_querier.go @@ -21,6 +21,16 @@ type fileQuerier struct { pkgs []*Package } +/* +files are stored in the following format: + +| partSize | hash1 | hash2 | ... | partSize | hash3 | hash4 | ... | partSize | hash5 | hash6 | ... | + +where partSize is the number of hashes in the part +and each part group is at the index of the given package +for example here hash5 would match pkgs[2] +*/ + func newFileQuerier(report *trivy.Report) fileQuerier { fileCount := 0 pkgCount := 0