threatflux_string_analysis/
types.rs

1//! Core types used throughout the library
2
3use serde::{Deserialize, Serialize};
4use std::collections::HashMap;
5
6/// Configuration for the string analysis system
7#[derive(Debug, Clone, Serialize, Deserialize)]
8pub struct AnalysisConfig {
9    /// Minimum entropy threshold for suspicious detection
10    pub min_suspicious_entropy: f64,
11    /// Maximum number of occurrences to track per string
12    pub max_occurrences_per_string: usize,
13    /// Enable time-based analysis features
14    pub enable_time_analysis: bool,
15    /// Custom metadata fields to track
16    pub custom_metadata_fields: Vec<String>,
17}
18
19impl Default for AnalysisConfig {
20    fn default() -> Self {
21        Self {
22            min_suspicious_entropy: 4.5,
23            max_occurrences_per_string: 1000,
24            enable_time_analysis: true,
25            custom_metadata_fields: Vec::new(),
26        }
27    }
28}
29
30/// Result type for string analysis operations
31pub type AnalysisResult<T> = anyhow::Result<T>;
32
33/// Metadata that can be attached to strings
34pub type StringMetadata = HashMap<String, serde_json::Value>;