Skip to main content

Module scanner

Module scanner 

Source
Expand description

Phase 1: candidate detection — finds potential classification markings in a byte buffer.

Uses memchr for SIMD-accelerated boundary detection. Zero heap allocation beyond the output Vec<MarkingCandidate>. Never invokes the parser.

§Strategy

  • Portion candidates: scan for ( with memchr, walk to ), apply lightweight heuristics (minimum length, ASCII uppercase content).
  • Banner candidates: scan for lines whose trimmed content begins with a known classification prefix (UNCLASSIFIED, CONFIDENTIAL, SECRET, TOP SECRET).
  • CAB candidates: scan for “Classified By:” label, walk to end of block.

Structs§

Scanner
Phase 1 scanner. Stateless; call Scanner::scan on any byte buffer.