version 0.2.2 (#59)

* replaced fxhash with gxhash
This commit is contained in:
Sreedev Kodichath
2024-07-04 23:23:01 -04:00
committed by GitHub
parent a56d194ee3
commit 028b868ea9
5 changed files with 285 additions and 401 deletions

View File

@@ -1,9 +1,10 @@
use anyhow::Result;
use gxhash::GxHasher;
use memmap2::Mmap;
use serde::Serialize;
use std::fs;
use std::hash::Hasher;
use std::{fs::Metadata, path::PathBuf};
use serde::Serialize;
#[derive(Debug, Clone, Serialize)]
pub struct FileInfo {
@@ -18,7 +19,7 @@ impl FileInfo {
pub fn hash(&self) -> Result<Self> {
let file = fs::File::open(self.path.clone())?;
let mapper = unsafe { Mmap::map(&file)? };
let mut primhasher = fxhash::FxHasher::default();
let mut primhasher = GxHasher::default();
mapper
.chunks(1_000_000)