btpeer 0.8.0

Simple CLI tool and library to get peers from TCP/HTTP and UDP BitTorrent trackers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[derive(Eq, Hash, PartialEq)]
pub enum InfoHash {
    V1(Vec<u8>),
}

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