Compare commits

...

3 Commits

Author SHA1 Message Date
Anna ee9de2a404
chore: bump version to 2.2.1 2022-12-16 10:02:17 -05:00
Anna 4c4fece53b
chore: save extracted files using base64 names 2022-12-16 10:02:01 -05:00
Anna 40c296224a
fix: clamp file offsets to file size 2022-12-16 10:01:51 -05:00
3 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "ttmp"
version = "2.2.0"
version = "2.2.1"
edition = "2021"
autoexamples = true
@ -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(),

View File

@ -145,7 +145,7 @@ impl MpdEncoder {
};
let mip_size = if next == 0 {
size as u32 - offset
size as u32 - offset.min(size as u32)
} else {
next - offset
};