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:
10
pkg/types/chunk.go
Normal file
10
pkg/types/chunk.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user