(path: &Path)
| 1238 | } |
| 1239 | |
| 1240 | fn hash_path_id(path: &Path) -> String { |
| 1241 | let mut hash: u64 = 0xcbf2_9ce4_8422_2325; |
| 1242 | for byte in path.to_string_lossy().as_bytes() { |
| 1243 | hash ^= u64::from(*byte); |
| 1244 | hash = hash.wrapping_mul(0x0100_0000_01b3); |
| 1245 | } |
| 1246 | format!("{:012x}", hash & 0x0000_ffff_ffff_ffff) |
| 1247 | } |
| 1248 | |
| 1249 | fn secure_socket_base(subdir: &str) -> Result<PathBuf, String> { |
| 1250 | let base = std::env::var_os("XDG_RUNTIME_DIR").map_or_else( |
no outgoing calls
no test coverage detected