mirror of
https://github.com/YGGverse/btracker.git
synced 2026-03-31 17:15:31 +00:00
15 lines
355 B
Rust
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>()
|
|
),
|
|
}
|
|
}
|
|
}
|