blazehash 0.2.3

Forensic file hasher — hashdeep for the modern era, BLAKE3 by default
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
//! Performance benchmark tests: blazehash vs hashdeep.
//!
//! All tests are `#[ignore]` — run with:
//!   cargo test --release --test benchmark_tests -- --ignored --nocapture --test-threads=1
//!
//! Requires `hashdeep` to be installed (brew install md5deep / apt install hashdeep).
//! Tests skip gracefully if hashdeep is not found.
//!
//! Methodology:
//! - All benchmarks include a warmup pass to eliminate filesystem cache bias
//! - Each timed scenario runs both tools on warm cache for fair comparison
//! - Large file tests use 256 MiB to amortize process startup overhead
//! - Results report wall-clock time including process spawn

use assert_cmd::Command;
use std::collections::HashMap;
use std::fs;
use std::path::Path;
use std::process;
use std::time::Instant;
use tempfile::TempDir;

/// Shared algorithms between blazehash and hashdeep.
const SHARED_ALGOS: &str = "md5,sha1,sha256,tiger,whirlpool";

/// Check whether hashdeep is available on PATH.
fn hashdeep_available() -> bool {
    process::Command::new("hashdeep")
        .arg("-V")
        .stdout(process::Stdio::null())
        .stderr(process::Stdio::null())
        .status()
        .map(|s| s.success())
        .unwrap_or(false)
}

/// Run blazehash and return (stdout, duration).
fn run_blazehash(args: &[&str]) -> (String, std::time::Duration) {
    let start = Instant::now();
    let output = Command::cargo_bin("blazehash")
        .unwrap()
        .args(args)
        .output()
        .unwrap();
    let elapsed = start.elapsed();
    let stdout = String::from_utf8(output.stdout).unwrap();
    assert!(
        output.status.success(),
        "blazehash failed: {}",
        String::from_utf8_lossy(&output.stderr)
    );
    (stdout, elapsed)
}

/// Run hashdeep and return (stdout, duration).
fn run_hashdeep(args: &[&str]) -> (String, std::time::Duration) {
    let start = Instant::now();
    let output = process::Command::new("hashdeep")
        .args(args)
        .output()
        .expect("failed to run hashdeep");
    let elapsed = start.elapsed();
    let stdout = String::from_utf8(output.stdout).unwrap();
    assert!(
        output.status.success(),
        "hashdeep failed: {}",
        String::from_utf8_lossy(&output.stderr)
    );
    (stdout, elapsed)
}

/// Warmup: run both tools once (discard results) to populate page cache.
fn warmup(blazehash_args: &[&str], hashdeep_args: &[&str]) {
    let _ = run_hashdeep(hashdeep_args);
    let _ = run_blazehash(blazehash_args);
}

/// Warmup for blazehash-only benchmarks.
fn warmup_blazehash(args: &[&str]) {
    let _ = run_blazehash(args);
}

/// Parse a hashdeep-format manifest into (path -> {algo -> hash}) map.
/// Works for both blazehash and hashdeep output.
fn parse_manifest(content: &str) -> HashMap<String, HashMap<String, String>> {
    let mut algorithms: Vec<String> = Vec::new();
    let mut records: HashMap<String, HashMap<String, String>> = HashMap::new();

    for line in content.lines() {
        if let Some(cols) = line.strip_prefix("%%%% size,") {
            let parts: Vec<&str> = cols.split(',').collect();
            algorithms = parts[..parts.len() - 1]
                .iter()
                .map(|s| s.to_string())
                .collect();
            continue;
        }
        if line.starts_with("%%%%") || line.starts_with('#') || line.is_empty() {
            continue;
        }
        let expected = algorithms.len() + 2;
        let parts: Vec<&str> = line.splitn(expected, ',').collect();
        if parts.len() < expected {
            continue;
        }
        let filename = parts[algorithms.len() + 1].to_string();
        let mut hashes = HashMap::new();
        for (i, algo) in algorithms.iter().enumerate() {
            hashes.insert(algo.clone(), parts[i + 1].to_string());
        }
        records.insert(filename, hashes);
    }
    records
}

/// Print a comparison result.
fn report_timing(label: &str, blazehash_ms: f64, hashdeep_ms: f64) {
    let speedup = hashdeep_ms / blazehash_ms;
    eprintln!(
        "\n  {label}:\n    blazehash: {blazehash_ms:.1}ms\n    hashdeep:  {hashdeep_ms:.1}ms\n    speedup:   {speedup:.2}x",
    );
}

/// Create a file filled with pseudo-random data (deterministic via simple LCG).
fn create_data_file(path: &Path, size: usize) {
    let mut data = vec![0u8; size];
    let mut state: u64 = 0xDEAD_BEEF;
    for byte in data.iter_mut() {
        state = state.wrapping_mul(6364136223846793005).wrapping_add(1);
        *byte = (state >> 33) as u8;
    }
    fs::write(path, &data).unwrap();
}

// ──────────────────────────────────────────────────────────────
// Benchmark: Single large file throughput (256 MiB)
// ──────────────────────────────────────────────────────────────

#[test]
#[ignore]
fn bench_single_large_file() {
    if !hashdeep_available() {
        eprintln!("SKIP: hashdeep not installed");
        return;
    }

    let dir = TempDir::new().unwrap();
    let file = dir.path().join("large.bin");
    create_data_file(&file, 256 * 1024 * 1024); // 256 MiB
    let file_str = file.to_str().unwrap();

    eprintln!("\n=== Single Large File (256 MiB) ===");

    for algo in ["md5", "sha1", "sha256", "tiger", "whirlpool"] {
        warmup(&["-c", algo, file_str], &["-c", algo, file_str]);
        let (_, bh_dur) = run_blazehash(&["-c", algo, file_str]);
        let (_, hd_dur) = run_hashdeep(&["-c", algo, file_str]);
        report_timing(
            algo,
            bh_dur.as_secs_f64() * 1000.0,
            hd_dur.as_secs_f64() * 1000.0,
        );
    }

    // All shared algorithms at once
    warmup(
        &["-c", SHARED_ALGOS, file_str],
        &["-c", SHARED_ALGOS, file_str],
    );
    let (_, bh_dur) = run_blazehash(&["-c", SHARED_ALGOS, file_str]);
    let (_, hd_dur) = run_hashdeep(&["-c", SHARED_ALGOS, file_str]);
    report_timing(
        "all 5 algos combined",
        bh_dur.as_secs_f64() * 1000.0,
        hd_dur.as_secs_f64() * 1000.0,
    );
}

// ──────────────────────────────────────────────────────────────
// Benchmark: Many small files (I/O overhead)
// ──────────────────────────────────────────────────────────────

#[test]
#[ignore]
fn bench_many_small_files() {
    if !hashdeep_available() {
        eprintln!("SKIP: hashdeep not installed");
        return;
    }

    let dir = TempDir::new().unwrap();
    for i in 0..1000 {
        let file = dir.path().join(format!("file_{i:04}.bin"));
        create_data_file(&file, 4096);
    }
    let dir_str = dir.path().to_str().unwrap();

    eprintln!("\n=== Many Small Files (1000 x 4 KiB) ===");

    // SHA-256 only
    warmup(
        &["-r", "-c", "sha256", dir_str],
        &["-r", "-c", "sha256", dir_str],
    );
    let (_, bh_dur) = run_blazehash(&["-r", "-c", "sha256", dir_str]);
    let (_, hd_dur) = run_hashdeep(&["-r", "-c", "sha256", dir_str]);
    report_timing(
        "1000 files, SHA-256",
        bh_dur.as_secs_f64() * 1000.0,
        hd_dur.as_secs_f64() * 1000.0,
    );

    // All 5 algos
    warmup(
        &["-r", "-c", SHARED_ALGOS, dir_str],
        &["-r", "-c", SHARED_ALGOS, dir_str],
    );
    let (_, bh_dur) = run_blazehash(&["-r", "-c", SHARED_ALGOS, dir_str]);
    let (_, hd_dur) = run_hashdeep(&["-r", "-c", SHARED_ALGOS, dir_str]);
    report_timing(
        "1000 files, all 5 algos",
        bh_dur.as_secs_f64() * 1000.0,
        hd_dur.as_secs_f64() * 1000.0,
    );
}

// ──────────────────────────────────────────────────────────────
// Benchmark: Recursive directory walk
// ──────────────────────────────────────────────────────────────

#[test]
#[ignore]
fn bench_recursive_walk() {
    if !hashdeep_available() {
        eprintln!("SKIP: hashdeep not installed");
        return;
    }

    let dir = TempDir::new().unwrap();
    // 5 x 5 x 20 = 500 files, 16 KiB each = 8 MiB total
    for i in 0..5 {
        let level1 = dir.path().join(format!("dir_{i}"));
        fs::create_dir(&level1).unwrap();
        for j in 0..5 {
            let level2 = level1.join(format!("sub_{j}"));
            fs::create_dir(&level2).unwrap();
            for k in 0..20 {
                let file = level2.join(format!("data_{k}.bin"));
                create_data_file(&file, 16384);
            }
        }
    }
    let dir_str = dir.path().to_str().unwrap();

    eprintln!("\n=== Recursive Walk (500 files, 3 levels, 8 MiB total) ===");

    warmup(
        &["-r", "-c", "sha256", dir_str],
        &["-r", "-c", "sha256", dir_str],
    );
    let (_, bh_dur) = run_blazehash(&["-r", "-c", "sha256", dir_str]);
    let (_, hd_dur) = run_hashdeep(&["-r", "-c", "sha256", dir_str]);
    report_timing(
        "recursive SHA-256",
        bh_dur.as_secs_f64() * 1000.0,
        hd_dur.as_secs_f64() * 1000.0,
    );

    warmup(
        &["-r", "-c", SHARED_ALGOS, dir_str],
        &["-r", "-c", SHARED_ALGOS, dir_str],
    );
    let (_, bh_dur) = run_blazehash(&["-r", "-c", SHARED_ALGOS, dir_str]);
    let (_, hd_dur) = run_hashdeep(&["-r", "-c", SHARED_ALGOS, dir_str]);
    report_timing(
        "recursive all 5 algos",
        bh_dur.as_secs_f64() * 1000.0,
        hd_dur.as_secs_f64() * 1000.0,
    );
}

// ──────────────────────────────────────────────────────────────
// Benchmark: Piecewise hashing
// ──────────────────────────────────────────────────────────────

#[test]
#[ignore]
fn bench_piecewise_hashing() {
    if !hashdeep_available() {
        eprintln!("SKIP: hashdeep not installed");
        return;
    }

    let dir = TempDir::new().unwrap();
    let file = dir.path().join("piecewise.bin");
    create_data_file(&file, 64 * 1024 * 1024); // 64 MiB
    let file_str = file.to_str().unwrap();

    eprintln!("\n=== Piecewise Hashing (64 MiB, 1M chunks) ===");

    warmup(
        &["-p", "1M", "-c", "sha256", file_str],
        &["-p", "1048576", "-c", "sha256", file_str],
    );
    let (_, bh_dur) = run_blazehash(&["-p", "1M", "-c", "sha256", file_str]);
    let (_, hd_dur) = run_hashdeep(&["-p", "1048576", "-c", "sha256", file_str]);
    report_timing(
        "piecewise SHA-256 (1M chunks)",
        bh_dur.as_secs_f64() * 1000.0,
        hd_dur.as_secs_f64() * 1000.0,
    );

    warmup(
        &["-p", "1M", "-c", SHARED_ALGOS, file_str],
        &["-p", "1048576", "-c", SHARED_ALGOS, file_str],
    );
    let (_, bh_dur) = run_blazehash(&["-p", "1M", "-c", SHARED_ALGOS, file_str]);
    let (_, hd_dur) = run_hashdeep(&["-p", "1048576", "-c", SHARED_ALGOS, file_str]);
    report_timing(
        "piecewise all 5 algos (1M chunks)",
        bh_dur.as_secs_f64() * 1000.0,
        hd_dur.as_secs_f64() * 1000.0,
    );
}

// ──────────────────────────────────────────────────────────────
// Correctness: Hash value compatibility
// ──────────────────────────────────────────────────────────────

#[test]
#[ignore]
fn compat_hash_values_match() {
    if !hashdeep_available() {
        eprintln!("SKIP: hashdeep not installed");
        return;
    }

    let dir = TempDir::new().unwrap();

    let test_cases: &[(&str, usize)] = &[
        ("empty.bin", 0),
        ("tiny.bin", 1),
        ("small.bin", 1000),
        ("medium.bin", 100_000),
        ("boundary.bin", 1024 * 1024),
    ];

    for (name, size) in test_cases {
        let file = dir.path().join(name);
        create_data_file(&file, *size);
    }

    eprintln!("\n=== Hash Compatibility Check ===");

    for algo in ["md5", "sha1", "sha256", "tiger", "whirlpool"] {
        for (name, _) in test_cases {
            let file = dir.path().join(name);
            let file_str = file.to_str().unwrap();

            let (bh_out, _) = run_blazehash(&["-c", algo, file_str]);
            let (hd_out, _) = run_hashdeep(&["-c", algo, file_str]);

            let bh_records = parse_manifest(&bh_out);
            let hd_records = parse_manifest(&hd_out);

            assert_eq!(
                bh_records.len(),
                1,
                "blazehash: expected 1 record for {name}"
            );
            assert_eq!(
                hd_records.len(),
                1,
                "hashdeep: expected 1 record for {name}"
            );

            let bh_hashes = bh_records.values().next().unwrap();
            let hd_hashes = hd_records.values().next().unwrap();
            let bh_hash = &bh_hashes[algo];
            let hd_hash = &hd_hashes[algo];

            assert_eq!(
                bh_hash, hd_hash,
                "hash mismatch for {algo} on {name}: blazehash={bh_hash}, hashdeep={hd_hash}"
            );
            eprintln!("  {algo:>10} x {name:<16} OK");
        }
    }
}

// ──────────────────────────────────────────────────────────────
// Correctness: Multi-algorithm output compatibility
// ──────────────────────────────────────────────────────────────

#[test]
#[ignore]
fn compat_multi_algo_values_match() {
    if !hashdeep_available() {
        eprintln!("SKIP: hashdeep not installed");
        return;
    }

    let dir = TempDir::new().unwrap();
    let file = dir.path().join("multi.bin");
    create_data_file(&file, 50_000);
    let file_str = file.to_str().unwrap();

    eprintln!("\n=== Multi-Algorithm Compatibility ===");

    let (bh_out, _) = run_blazehash(&["-c", SHARED_ALGOS, file_str]);
    let (hd_out, _) = run_hashdeep(&["-c", SHARED_ALGOS, file_str]);

    let bh_records = parse_manifest(&bh_out);
    let hd_records = parse_manifest(&hd_out);

    let bh_hashes = bh_records.values().next().unwrap();
    let hd_hashes = hd_records.values().next().unwrap();

    for algo in ["md5", "sha1", "sha256", "tiger", "whirlpool"] {
        let bh_hash = &bh_hashes[algo];
        let hd_hash = &hd_hashes[algo];
        assert_eq!(
            bh_hash, hd_hash,
            "multi-algo mismatch for {algo}: blazehash={bh_hash}, hashdeep={hd_hash}"
        );
        eprintln!("  {algo:>10}: {bh_hash} OK");
    }
}

// ──────────────────────────────────────────────────────────────
// Correctness: Audit cross-compatibility
// ──────────────────────────────────────────────────────────────

#[test]
#[ignore]
fn compat_audit_hashdeep_manifest() {
    if !hashdeep_available() {
        eprintln!("SKIP: hashdeep not installed");
        return;
    }

    let dir = TempDir::new().unwrap();
    for i in 0..5 {
        let file = dir.path().join(format!("file_{i}.txt"));
        fs::write(&file, format!("content of file {i}")).unwrap();
    }
    let manifest = dir.path().join("manifest_hd.hash");
    let dir_str = dir.path().to_str().unwrap();
    let manifest_str = manifest.to_str().unwrap();

    eprintln!("\n=== Cross-Tool Audit Compatibility ===");

    let (hd_out, _) = run_hashdeep(&["-r", "-c", "sha256", dir_str]);
    fs::write(&manifest, &hd_out).unwrap();

    let output = Command::cargo_bin("blazehash")
        .unwrap()
        .args(["-a", "-k", manifest_str, "-r", dir_str])
        .output()
        .unwrap();

    let stdout = String::from_utf8(output.stdout).unwrap();
    eprintln!("  blazehash audit of hashdeep manifest:\n  {stdout}");

    assert!(
        stdout.contains("Files matched: 5") || stdout.contains("Files matched: 6"),
        "expected all files to match, got: {stdout}"
    );
    assert!(
        stdout.contains("Files changed: 0"),
        "expected no changed files, got: {stdout}"
    );
}

// ──────────────────────────────────────────────────────────────
// Correctness: Piecewise hash compatibility
// ──────────────────────────────────────────────────────────────

#[test]
#[ignore]
fn compat_piecewise_values_match() {
    if !hashdeep_available() {
        eprintln!("SKIP: hashdeep not installed");
        return;
    }

    let dir = TempDir::new().unwrap();
    let file = dir.path().join("piecewise.bin");
    create_data_file(&file, 10_000);
    let file_str = file.to_str().unwrap();

    eprintln!("\n=== Piecewise Hash Compatibility (10 KiB, 4K chunks) ===");

    let (bh_out, _) = run_blazehash(&["-p", "4096", "-c", "sha256", file_str]);
    let (hd_out, _) = run_hashdeep(&["-p", "4096", "-c", "sha256", file_str]);

    let bh_data: Vec<&str> = bh_out
        .lines()
        .filter(|l| !l.starts_with("%%") && !l.starts_with('#') && !l.is_empty())
        .collect();
    let hd_data: Vec<&str> = hd_out
        .lines()
        .filter(|l| !l.starts_with("%%") && !l.starts_with('#') && !l.is_empty())
        .collect();

    assert_eq!(
        bh_data.len(),
        hd_data.len(),
        "piecewise chunk count mismatch: blazehash={}, hashdeep={}",
        bh_data.len(),
        hd_data.len()
    );

    for (i, (bh_line, hd_line)) in bh_data.iter().zip(hd_data.iter()).enumerate() {
        let bh_parts: Vec<&str> = bh_line.splitn(3, ',').collect();
        let hd_parts: Vec<&str> = hd_line.splitn(3, ',').collect();

        assert_eq!(
            bh_parts[0], hd_parts[0],
            "chunk {i} size mismatch: blazehash={}, hashdeep={}",
            bh_parts[0], hd_parts[0]
        );
        assert_eq!(
            bh_parts[1], hd_parts[1],
            "chunk {i} hash mismatch: blazehash={}, hashdeep={}",
            bh_parts[1], hd_parts[1]
        );
        eprintln!("  chunk {i}: size={} hash={} OK", bh_parts[0], bh_parts[1]);
    }
}

// ──────────────────────────────────────────────────────────────
// Benchmark: BLAKE3 advantage (blazehash-only, no hashdeep)
// Shows what you gain by using BLAKE3 instead of legacy algos
// ──────────────────────────────────────────────────────────────

#[test]
#[ignore]
fn bench_blake3_advantage() {
    let dir = TempDir::new().unwrap();
    let file = dir.path().join("blake3.bin");
    create_data_file(&file, 256 * 1024 * 1024); // 256 MiB
    let file_str = file.to_str().unwrap();

    eprintln!("\n=== BLAKE3 Advantage (256 MiB, blazehash only) ===");

    for algo in [
        "blake3",
        "sha256",
        "sha512",
        "sha3-256",
        "md5",
        "sha1",
        "tiger",
        "whirlpool",
    ] {
        warmup_blazehash(&["-c", algo, file_str]);
        let (_, dur) = run_blazehash(&["-c", algo, file_str]);
        eprintln!("  {algo:>10}: {:.1}ms", dur.as_secs_f64() * 1000.0);
    }

    // All 8 algorithms at once
    let all_algos = "blake3,sha256,sha512,sha3-256,md5,sha1,tiger,whirlpool";
    warmup_blazehash(&["-c", all_algos, file_str]);
    let (_, dur) = run_blazehash(&["-c", all_algos, file_str]);
    eprintln!("  {:>10}: {:.1}ms", "all 8", dur.as_secs_f64() * 1000.0);
}

// ──────────────────────────────────────────────────────────────
// Format: Manifest format interoperability
// ──────────────────────────────────────────────────────────────

#[test]
#[ignore]
fn compat_manifest_format_structure() {
    if !hashdeep_available() {
        eprintln!("SKIP: hashdeep not installed");
        return;
    }

    let dir = TempDir::new().unwrap();
    let file = dir.path().join("format.txt");
    fs::write(&file, b"format test content").unwrap();
    let file_str = file.to_str().unwrap();

    eprintln!("\n=== Manifest Format Structure ===");

    let (bh_out, _) = run_blazehash(&["-c", "sha256", file_str]);
    let (hd_out, _) = run_hashdeep(&["-c", "sha256", file_str]);

    assert!(
        bh_out.contains("HASHDEEP-1.0"),
        "blazehash missing HASHDEEP-1.0 header"
    );
    assert!(
        hd_out.contains("HASHDEEP-1.0"),
        "hashdeep missing HASHDEEP-1.0 header"
    );

    assert!(
        bh_out.contains("%%%% size,sha256,filename"),
        "blazehash missing column definition"
    );
    assert!(
        hd_out.contains("%%%% size,sha256,filename"),
        "hashdeep missing column definition"
    );

    let bh_data_count = bh_out
        .lines()
        .filter(|l| !l.starts_with("%%") && !l.starts_with('#') && !l.is_empty())
        .count();
    let hd_data_count = hd_out
        .lines()
        .filter(|l| !l.starts_with("%%") && !l.starts_with('#') && !l.is_empty())
        .count();
    assert_eq!(
        bh_data_count, hd_data_count,
        "data line count differs: blazehash={bh_data_count}, hashdeep={hd_data_count}"
    );

    eprintln!("  Both produce HASHDEEP-1.0 header: OK");
    eprintln!("  Both produce matching column definition: OK");
    eprintln!("  Both produce {bh_data_count} data line(s): OK");
}