public class HashDistance extends Object
Computes the XOR distance between two router hashes by performing a bitwise XOR operation on the hash data. Used in Kademlia-based distributed hash tables for determining key proximity and routing decisions.
Returns the result as a BigInteger to handle the full 256-bit hash space without overflow issues. The distance metric is fundamental to Kademlia DHT operations including key lookup, peer selection, and network topology analysis.
| Constructor and Description |
|---|
HashDistance() |
| Modifier and Type | Method and Description |
|---|---|
static BigInteger |
getDistance(Hash targetKey,
Hash routerInQuestion) |
public static BigInteger getDistance(Hash targetKey, Hash routerInQuestion)