initial commit

This commit is contained in:
yggverse 2025-08-01 20:04:38 +03:00
parent 9c4cc62a4f
commit de0747366d
12 changed files with 644 additions and 0 deletions

15
src/api/info_hash.rs Normal file
View 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>()
),
}
}
}