@@ -6,20 +6,37 @@ fn main() {
66
77 // Method 1: Raw bytes
88 println ! ( "=== Raw bytes ===" ) ;
9- let r1 = cryptotrace:: analyzers:: file:: analyze_bytes ( test_data, cryptotrace:: types:: SourceType :: Binary ) . unwrap ( ) ;
10- println ! ( " algo={:?} type={} ent={:.2} conf={:.2}" , r1. algorithm, r1. detected_type, r1. entropy, r1. confidence) ;
9+ let r1 = cryptotrace:: analyzers:: file:: analyze_bytes (
10+ test_data,
11+ cryptotrace:: types:: SourceType :: Binary ,
12+ )
13+ . unwrap ( ) ;
14+ println ! (
15+ " algo={:?} type={} ent={:.2} conf={:.2}" ,
16+ r1. algorithm, r1. detected_type, r1. entropy, r1. confidence
17+ ) ;
1118
1219 // Method 2: File
1320 println ! ( "=== From file ===" ) ;
1421 let r2 = cryptotrace:: analyzers:: file:: analyze_file ( Path :: new ( "Cargo.toml" ) ) . unwrap ( ) ;
15- println ! ( " algo={:?} type={} ent={:.2} conf={:.2}" , r2. algorithm, r2. detected_type, r2. entropy, r2. confidence) ;
22+ println ! (
23+ " algo={:?} type={} ent={:.2} conf={:.2}" ,
24+ r2. algorithm, r2. detected_type, r2. entropy, r2. confidence
25+ ) ;
1626
1727 // Method 3: Stdin (if piped)
1828 println ! ( "=== Stdin (pipe data or skip) ===" ) ;
1929 let mut buf = Vec :: new ( ) ;
2030 if std:: io:: stdin ( ) . read_to_end ( & mut buf) . is_ok ( ) && !buf. is_empty ( ) {
21- let r3 = cryptotrace:: analyzers:: file:: analyze_bytes ( & buf, cryptotrace:: types:: SourceType :: Binary ) . unwrap ( ) ;
22- println ! ( " algo={:?} type={} ent={:.2} conf={:.2}" , r3. algorithm, r3. detected_type, r3. entropy, r3. confidence) ;
31+ let r3 = cryptotrace:: analyzers:: file:: analyze_bytes (
32+ & buf,
33+ cryptotrace:: types:: SourceType :: Binary ,
34+ )
35+ . unwrap ( ) ;
36+ println ! (
37+ " algo={:?} type={} ent={:.2} conf={:.2}" ,
38+ r3. algorithm, r3. detected_type, r3. entropy, r3. confidence
39+ ) ;
2340 } else {
2441 println ! ( " (no stdin data)" ) ;
2542 }
0 commit comments