using StellaOps.AuditPack.Models; namespace StellaOps.AuditPack.Services; public sealed partial class AuditBundleWriter { private static string? AddRequiredEntry( List entries, List files, List archiveEntries, string path, byte[]? content, BundleContentType type) { return content is null ? null : AddEntry(entries, files, archiveEntries, path, content, type); } private static string? AddOptionalEntry( List entries, List files, List archiveEntries, string path, byte[]? content, BundleContentType type) { return content is null ? null : AddEntry(entries, files, archiveEntries, path, content, type); } private static string AddEntry( List entries, List files, List archiveEntries, string path, byte[] content, BundleContentType type) { var digest = ComputeSha256(content); entries.Add(new BundleEntry(path, digest, content.Length)); files.Add(new BundleFileEntry { RelativePath = path, Digest = digest, SizeBytes = content.Length, ContentType = type }); archiveEntries.Add(new ArchiveEntry(path, content)); return digest; } }