mirror of https://github.com/oxen-io/lokinet
hidden service tags
parent
ac4faf23b5
commit
bb8d566671
@ -0,0 +1,32 @@
|
||||
#ifndef LLARP_SERVICE_TAG_HPP
|
||||
#define LLARP_SERVICE_TAG_HPP
|
||||
|
||||
#include <llarp/aligned.hpp>
|
||||
|
||||
namespace llarp
|
||||
{
|
||||
namespace service
|
||||
{
|
||||
struct Tag : public llarp::AlignedBuffer< 16 >
|
||||
{
|
||||
Tag() : llarp::AlignedBuffer< 16 >()
|
||||
{
|
||||
Zero();
|
||||
}
|
||||
|
||||
Tag(const byte_t* d) : llarp::AlignedBuffer< 16 >(d)
|
||||
{
|
||||
}
|
||||
|
||||
Tag(const std::string& str) : Tag()
|
||||
{
|
||||
memcpy(data(), str.c_str(), std::min(16UL, str.size()));
|
||||
}
|
||||
|
||||
std::string
|
||||
ToString() const;
|
||||
};
|
||||
} // namespace service
|
||||
} // namespace llarp
|
||||
|
||||
#endif
|
@ -0,0 +1,13 @@
|
||||
#include <llarp/service/tag.hpp>
|
||||
|
||||
namespace llarp
|
||||
{
|
||||
namespace service
|
||||
{
|
||||
std::string
|
||||
Tag::ToString() const
|
||||
{
|
||||
return std::string((const char *)data());
|
||||
}
|
||||
} // namespace service
|
||||
} // namespace llarp
|
Loading…
Reference in New Issue