Skip to main content

is_encoded_binary

Function is_encoded_binary 

Source
pub fn is_encoded_binary(candidate: &str) -> bool
Expand description

Conservative verdict for the confidence pipeline: does this generic candidate decode to identifiable binary / serialized data? Real secrets return false.

Memoized: a single match is scored on this twice (ML feature #41 in ml_features and the generic-detector confidence penalty in confidence::penalties), and a scan re-encounters the same token across chunks. Without the cache every call re-decodes and re-parses the bytes. Thread-local + bounded with wholesale eviction, mirroring entropy::shannon_entropy. The verdict is a pure function of candidate, so caching by content hash is always correct.