1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
lokinet/include/llarp/dht/kademlia.hpp
2018-07-17 14:37:50 +10:00

24 lines
427 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);
};
};
} // namespace dht
} // namespace llarp
#endif