feat(01-04): add shared Chunk type, Finding struct, Shannon entropy, and MaskKey

- pkg/types/chunk.go: shared Chunk struct breaking engine<->sources circular import
- pkg/engine/finding.go: Finding struct with MaskKey for pipeline output
- pkg/engine/entropy.go: Shannon entropy function using math.Log2
- pkg/engine/entropy_test.go: TDD tests for Shannon and MaskKey
This commit is contained in:
salvacybersec
2026-04-05 12:18:26 +03:00
parent ef8717b9ab
commit 45cc676f55
4 changed files with 90 additions and 0 deletions

10
pkg/types/chunk.go Normal file
View File

@@ -0,0 +1,10 @@
package types
// Chunk is a segment of file content passed through the scanning pipeline.
// Defined in pkg/types (not pkg/engine) so that pkg/engine/sources can use it
// without creating a circular import with pkg/engine.
type Chunk struct {
Data []byte // raw bytes
Source string // file path, URL, or description
Offset int64 // byte offset of this chunk within the source
}