faster hashing algorithm

This commit is contained in:
sreedev
2022-12-30 00:25:07 -05:00
parent 64e122b6ce
commit 2cfb298468
5 changed files with 20 additions and 3 deletions

View File

@@ -67,6 +67,7 @@ pub fn duplicate_hashes(connection: &sqlite::Connection, path: &String) -> Resul
ORDER BY a.file_identifier
", path
);
let result: Vec<File> = connection
.prepare(query)?
.into_iter()

View File

@@ -48,7 +48,7 @@ pub fn print(duplicates: Vec<File>) {
group.into_iter().for_each(|file| {
println!(
"| {0: <16} | {1: <35} | {2: <16} | {3: <32} |",
&file.hash[0..16].red(),
file.hash.red(),
format_path(&file.path).yellow(),
file_size(&file.path).blue(),
modified_time(&file.path).blue()

View File

@@ -6,7 +6,7 @@ use itertools::Itertools;
use rayon::prelude::*;
use std::fs;
use std::path::PathBuf;
use xxhash_rust::xxh3::xxh3_64 as hasher;
use fxhash::hash32 as hasher;
pub fn duplicates(app_opts: &App, connection: &sqlite::Connection) -> Result<Vec<File>> {
let scan_results = scan(app_opts, connection)?;