1mod dir_comparer;
2mod file_comparer;
3pub(crate) mod file_hash_cache;
4mod file_hasher;
5mod progress_reporter;
6
7pub use dir_comparer::{DirectoryComparer, FileComparisonMethod};
8pub use file_comparer::{Classification, FileComparer, FileComparisonResult};
9pub use file_hasher::{DuplicatedFiles, FileHasher};
10pub(crate) use progress_reporter::ProgressReporter;
11
12pub(crate) fn human_readable_size(size: u64) -> String {
13 const MB: u64 = 1024 * 1024;
14 const GB: u64 = 1024 * 1024 * 1024;
15 if size >= GB {
16 format!("{:.1}GB", size as f64 / GB as f64)
17 } else if size >= MB {
18 format!("{:.1}MB", size as f64 / MB as f64)
19 } else {
20 format!("{} bytes", size)
21 }
22}