mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-21 04:07:46 +00:00
Add calculate_partial_hash function
This commit is contained in:
parent
0896ef829c
commit
5c5d2f85bb
1 changed files with 7 additions and 0 deletions
|
@ -11,6 +11,13 @@ use crate::dat::{BlockHeader, CompressionMode};
|
||||||
|
|
||||||
const CRC: Jamcrc = Jamcrc::new();
|
const CRC: Jamcrc = Jamcrc::new();
|
||||||
|
|
||||||
|
/// Calculates a partial hash for a given path
|
||||||
|
pub fn calculate_partial_hash(path: &str) -> u32 {
|
||||||
|
let lowercase = path.to_lowercase();
|
||||||
|
|
||||||
|
CRC.checksum(lowercase.as_bytes())
|
||||||
|
}
|
||||||
|
|
||||||
/// Calculates a hash for `index` files from a game path.
|
/// Calculates a hash for `index` files from a game path.
|
||||||
pub fn calculate_hash(path: &str) -> u64 {
|
pub fn calculate_hash(path: &str) -> u64 {
|
||||||
let lowercase = path.to_lowercase();
|
let lowercase = path.to_lowercase();
|
||||||
|
|
Loading…
Add table
Reference in a new issue