use std::path::PathBuf;
pub const HOME_VAR: &str = "AXIOPERA_HOME";
pub fn default_home() -> PathBuf {
if let Some(h) = std::env::var_os(HOME_VAR) {
return PathBuf::from(h);
}
let home =
std::env::var_os(if cfg!(windows) { "USERPROFILE" } else { "HOME" }).unwrap_or_default();
PathBuf::from(home).join(".axiopera")
}
pub fn fnv1a(bytes: &[u8]) -> u64 {
bytes.iter().fold(0xcbf29ce484222325, |h, b| {
(h ^ *b as u64).wrapping_mul(0x100000001b3)
})
}