cdragon_hashes/wad.rs
1//! Hashes used in WAD archives
2//!
3//! File paths in WAD archive are hashed using 64-bit xxHash
4use std::hash::Hasher;
5use twox_hash::XxHash64;
6use crate::HashMapper;
7
8/// Compute a hash for a WAD file path
9pub fn compute_wad_hash(s: &str) -> u64 {
10 let mut h = XxHash64::with_seed(0);
11 h.write(s.as_bytes());
12 h.finish()
13}
14
15/// Mapper for WAD hashes
16pub type WadHashMapper = HashMapper<u64, 64>;
17