From c4b0fc46f37b2db4b3c1cc8659cdbf5a42b3e34e Mon Sep 17 00:00:00 2001 From: Anna Date: Fri, 16 Dec 2022 10:02:01 -0500 Subject: [PATCH] chore: save extracted files using base64 names --- Cargo.toml | 2 +- examples/extract_dedupe_in_memory.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ebd9e8c..7e2c419 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ sqpack = { git = "https://git.anna.lgbt/ascclemens/sqpack-rs", features = ["read [dev-dependencies] criterion = "0.4" -hex = "0.4" +base64 = "0.13" sha3 = "0.10" tempfile = "3" diff --git a/examples/extract_dedupe_in_memory.rs b/examples/extract_dedupe_in_memory.rs index c7f9a0d..aa030b4 100644 --- a/examples/extract_dedupe_in_memory.rs +++ b/examples/extract_dedupe_in_memory.rs @@ -55,7 +55,7 @@ pub fn main() { std::io::copy(&mut temp, &mut sha).unwrap(); temp.seek(SeekFrom::Start(0)).unwrap(); let hash = sha.finalize_reset(); - let hash = hex::encode(&*hash); + let hash = base64::encode_config(&*hash, base64::URL_SAFE_NO_PAD); let new = !hashes.contains_key(&hash); let saved = SavedFile { game_path: file.file.full_path.clone(),