lokinet/include/llarp/service/address.hpp
Jeff Becker 5bbaae4e2e
more
2018-07-12 14:21:44 -04:00

38 lines
710 B
C++

#ifndef LLARP_SERVICE_ADDRESS_HPP
#define LLARP_SERVICE_ADDRESS_HPP
#include <llarp/aligned.hpp>
#include <llarp/dht/key.hpp>
#include <string>
namespace llarp
{
namespace service
{
struct Address : public llarp::AlignedBuffer< 32 >
{
std::string
ToString() const;
Address() : llarp::AlignedBuffer< 32 >()
{
}
Address(const byte_t* data) : llarp::AlignedBuffer< 32 >(data)
{
}
struct Hash
{
size_t
operator()(const Address& addr) const
{
size_t idx = 0;
memcpy(&idx, addr, sizeof(idx));
return idx;
}
};
};
} // namespace service
} // namespace llarp
#endif