mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
421 B
C++
25 lines
421 B
C++
6 years ago
|
#ifndef LLARP_DHT_KADEMLIA_HPP
|
||
|
#define LLARP_DHT_KADEMLIA_HPP
|
||
|
|
||
6 years ago
|
#include <dht/key.hpp>
|
||
6 years ago
|
|
||
|
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);
|
||
|
};
|
||
|
};
|
||
6 years ago
|
} // namespace dht
|
||
|
} // namespace llarp
|
||
6 years ago
|
#endif
|