Bittorrent KRPC-为什么节点ID的大小是info_hash的一半,并使用每个字符a-z? [英] Bittorrent KRPC - Why are node ID's half the size of an info_hash and use every character a-z?

查看:195
本文介绍了Bittorrent KRPC-为什么节点ID的大小是info_hash的一半,并使用每个字符a-z?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这严重困扰了我.

原始的Kademlia提议出于明显的原因,应使用类似于sha1的160位十六进制: 在搜索与信息哈希相关的对等节点时,您可以简单地搜索nodeID,因为它们应该与sha1信息哈希相同的系统.

The original Kademlia offers that 160bit hex like a sha1 should be used for obvious reasons: When searching for peers relating to an infohash, you simple search nodeIDs as they should be equivalent to the same system as the sha1 infohash.

但请阅读以下内容: http://www.bittorrent.org/beps/bep_0005.html

But reading this: http://www.bittorrent.org/beps/bep_0005.html

id为abcdefghi0123456789,即: 1)一半大小 2)比标准的十六进制编码使用更多的字符.

the id's are abcdefghi0123456789 which is: 1) Half the size 2) Uses more characters then standard hex encoding.

那我想念什么?

为什么节点ID是这样的?

Why are node id's like this?

推荐答案

要使示例中的原始二进制node_id可打印,
巧妙地选择了它仅包含字母数字字符.
示例中的node_id实际上是:abcdefghij0123456789
如您所见,预期有20个字符= 20个字节= 160位.

To make the raw binary node_id in the examples printable,
it has cleverly been chosen to consist of only alphanumeric characters.
The node_id in the examples are actually: abcdefghij0123456789
As you can see there are 20 characters = 20 bytes = 160 bits as expected.

abcdefghij0123456789十六进制编码为:0x6162636465666768696A30313233343536373839

这篇关于Bittorrent KRPC-为什么节点ID的大小是info_hash的一半,并使用每个字符a-z?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆