Bittorrent跟踪器请求,info

编程入门 行业动态 更新时间:2024-10-24 12:25:35
Bittorrent跟踪器请求,info_hash格式(Bittorrent tracker request, format of info_hash)

当我想向跟踪器发送初始请求时,我所见过的所有引用都需要进行网址编码。 如果我将信息密钥的SHA-1散列转换为十六进制字符串,为什么需要对散列进行网址编码? 它只包含允许的字符。

When I want to send an initial request to a tracker all references I've seen says it needs to be url-encoded. If I transform the SHA-1 hash I have of the info key into a hex string, why would I need to url-encode the hash? It only contains allowed characters.

最满意答案

info_hash参数不是十六进制字符串。 这是一个纯粹的二进制字符串,所以是的,你将不得不对其中的许多字节进行URL编码。 (这最终会使得它比使用十六进制编码的字符串更长,但这是您的BitTorrent协议,现在已经太迟了,无法做任何事情!)

The info_hash parameter is not a hex string. It's a pure binary string, so yes, you will have to URL-encode many of the bytes in it. (This tends to make it longer in the end than just using a hex-encoded string, but that's the BitTorrent protocol for you, too late to do anything about it now!)

更多推荐

本文发布于:2023-07-16 12:39:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1128557.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:跟踪器   Bittorrent   info

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!