net.i2p.router.util

## Class HashDistance

- java.lang.Object
- - net.i2p.router.util.HashDistance

-     public class HashDistance
      extends Object

  Utility for calculating XOR distance between router hashes.

  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 Summary

    Constructors
    Constructor and Description
    `HashDistance()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static BigInteger` | `getDistance(Hash targetKey, Hash routerInQuestion)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HashDistance

          public HashDistance()

  - ### Method Detail

    - #### getDistance

          public static BigInteger getDistance(Hash targetKey,
                                               Hash routerInQuestion)