mirror of
https://github.com/YGGverse/btracker.git
synced 2026-04-01 01:25:33 +00:00
initial commit
This commit is contained in:
parent
9c4cc62a4f
commit
de0747366d
12 changed files with 644 additions and 0 deletions
15
src/api/info_hash.rs
Normal file
15
src/api/info_hash.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
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>()
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue