mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-10-29 11:05:43 +00:00
25 lines
389 B
C++
25 lines
389 B
C++
#ifndef LLARP_DHT_KADEMLIA_HPP
|
|
#define LLARP_DHT_KADEMLIA_HPP
|
|
|
|
#include <llarp/dht/key.hpp>
|
|
|
|
namespace llarp
|
|
{
|
|
namespace dht
|
|
{
|
|
struct XorMetric
|
|
{
|
|
const Key_t& us;
|
|
|
|
XorMetric(const Key_t& ourKey) : us(ourKey){};
|
|
|
|
bool
|
|
operator()(const Key_t& left, const Key_t& right) const
|
|
{
|
|
return (us ^ left) < (us ^ right);
|
|
};
|
|
};
|
|
}
|
|
}
|
|
#endif
|