btracker/src/api/info_hash.rs
2025-08-01 20:04:38 +03:00

15 lines
355 B
Rust

pub enum InfoHash {
V1([u8; 20]),
}
impl std::fmt::Display for InfoHash {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::V1(i) => write!(
f,
"{}",
i.iter().map(|b| format!("{b:02x}")).collect::<String>()
),
}
}
}