Documentation
¶
Overview ¶
Package par2gen builds minimal valid PAR2 index files in memory for use in tests that exercise PAR2-based filename deobfuscation.
Only FileDesc packets are emitted — enough for the par2.GetFileDescriptors path that reconstructs real filenames from obfuscated Usenet releases. No recovery blocks, IFSC, or Main packets are generated; the par2 reader used by altmount ignores those packet types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build returns the binary content of a minimal PAR2 index containing one FileDesc packet per entry. The result can be served directly from fakepool as the payload for a PAR2 index segment.
func PacketTypeFileDescT ¶
func PacketTypeFileDescT() [16]byte
func PacketTypeIFSCT ¶
func PacketTypeIFSCT() [16]byte
func PacketTypePARMain ¶
func PacketTypePARMain() [16]byte
Packet type constants, duplicated from the par2 parser package to avoid a testsupport -> production import in this direction (the parser tests import par2gen, so par2gen importing the parser would be a cycle).
func PacketTypeRecvSlicT ¶
func PacketTypeRecvSlicT() [16]byte
func VandermondeBase ¶
VandermondeBase returns the j-th PAR2 Vandermonde generator: 2^i in GF(2^16), skipping exponents divisible by 3, 5, 17 or 257 (elements whose order is below 65535). Grows a cached table on demand.
Types ¶
type FileEntry ¶
type FileEntry struct {
// Name is the real (unobfuscated) filename.
Name string
// Content is the file payload. The first 16 KB (zero-padded to exactly
// 16384 bytes) determines Hash16k, which is how the importer matches
// obfuscated files to their real names.
Content []byte
}
FileEntry describes one file that should appear in the generated PAR2 index.
type FullSet ¶
FullSet is a complete, spec-valid PAR2 set: an index file (Main + FileDesc + IFSC packets) and one volume file per recovery slice (a RecvSlic packet).