private int distanceFrom(final PeerId peer) {
    final Integer distance = distanceCache.get(peer.getId());
    return distance == null
        ? PeerDistanceCalculator.distance(keccak256, peer.keccak256())
        : distance;
  }
Calculates the XOR distance between the keccak-256 hashes of our node ID and the provided
{@link DiscoveryPeer}.

@param peer The target peer.
@return The distance.
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/internal/PeerTable.java