Module torrust_tracker::servers::http::percent_encoding
source · Expand description
This module contains functions for percent decoding infohashes and peer IDs.
Percent encoding is an encoding format used to encode arbitrary data in a format that is safe to use in URLs. It is used by the HTTP tracker protocol to encode infohashes and peer ids in the URLs of requests.
BitTorrent infohashes and peer ids are percent encoded like any other
arbitrary URL parameter. But they are encoded from binary data (byte arrays)
which may not be valid UTF-8. That makes hard to use the percent_encoding
crate to decode them because all of them expect a well-formed UTF-8 string.
However, percent encoding is not limited to UTF-8 strings.
More information about “Percent Encoding” can be found here: