Skip to content

Commit d9a1d12

Browse files
authored
Merge pull request #7 from DrTobe/refactor/replace-fasthash-by-seahash
Replace crate fasthash by seahash
2 parents 1449f21 + 062bc7e commit d9a1d12

File tree

3 files changed

+18
-105
lines changed

3 files changed

+18
-105
lines changed

Cargo.lock

Lines changed: 16 additions & 102 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ anyhow = "1.0.95"
1919
cached = "0.42.0"
2020
clap = {version = "4.5.26", features = ["derive"]}
2121
crossterm = { version = "0.26.1", features = ["event-stream"] }
22-
fasthash = "0.4.0"
22+
seahash = "4.1.0"
2323
fs_extra = "1.3.0"
2424
futures = "0.3.31"
2525
image = "0.24.9"

src/panel/preview.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use crossterm::{
2020
style::{self, Colors, Print, ResetColor, SetColors},
2121
Result,
2222
};
23-
use fasthash::sea;
2423
use image::DynamicImage;
2524
use once_cell::sync::OnceCell;
2625

@@ -275,7 +274,7 @@ fn video_preview(path: impl AsRef<Path>, modified: SystemTime) -> Preview {
275274
fn ffmpeg_thumbnail(path: impl AsRef<Path>, modified: u64) -> anyhow::Result<Preview> {
276275
static THUMBNAIL_DIR: OnceCell<PathBuf> = OnceCell::new();
277276
let full_path = path.as_ref().as_os_str();
278-
let path_hash = sea::hash64(full_path.as_encoded_bytes());
277+
let path_hash = seahash::hash(full_path.as_encoded_bytes());
279278
let identifier = format!("{path_hash}{modified}.jpg");
280279
let thumbnail = THUMBNAIL_DIR.get_or_init(temp_dir).join(identifier);
281280
if thumbnail.exists() {

0 commit comments

Comments
 (0)