问题
This has seriously perplexed me.
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.
But reading this: http://www.bittorrent.org/beps/bep_0005.html
the id's are abcdefghi0123456789
which is:
1) Half the size
2) Uses more characters then standard hex encoding.
So what am I missing?
Why are node id's like this?
回答1:
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
hex-encoded is: 0x6162636465666768696A30313233343536373839
来源:https://stackoverflow.com/questions/42143107/bittorrent-krpc-why-are-node-ids-half-the-size-of-an-info-hash-and-use-every