chore: save extracted files using base64 names

This commit is contained in:
Anna 2022-12-16 10:02:01 -05:00
parent 98dde15d59
commit c4b0fc46f3
2 changed files with 2 additions and 2 deletions

View File

@ -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"

View File

@ -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(),