torrust_tracker/shared/bit_torrent/common.rs
1//! `BitTorrent` protocol primitive types
2//!
3//! [BEP 3. The `BitTorrent` Protocol Specification](https://www.bittorrent.org/beps/bep_0003.html)
4
5/// The maximum number of torrents that can be returned in an `scrape` response.
6///
7/// The [BEP 15. UDP Tracker Protocol for `BitTorrent`](https://www.bittorrent.org/beps/bep_0015.html)
8/// defines this limit:
9///
10/// "Up to about 74 torrents can be scraped at once. A full scrape can't be done
11/// with this protocol."
12///
13/// The [BEP 48. Tracker Protocol Extension: Scrape](https://www.bittorrent.org/beps/bep_0048.html)
14/// does not specifically mention this limit, but the limit is being used for
15/// both the UDP and HTTP trackers since it's applied at the domain level.
16pub const MAX_SCRAPE_TORRENTS: u8 = 74;
17
18/// HTTP tracker authentication key length.
19///
20/// For more information see function [`generate_key`](crate::core::auth::generate_key) to generate the
21/// [`PeerKey`](crate::core::auth::PeerKey).
22pub const AUTH_KEY_LENGTH: usize = 32;