mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-03 23:15:52 +00:00
d511057b7d
* nicknames in RC (yw kee) * spec update * more hidden service code
25 lines
545 B
C++
25 lines
545 B
C++
#include <llarp/service/address.hpp>
|
|
|
|
namespace llarp
|
|
{
|
|
namespace service
|
|
{
|
|
std::string
|
|
Address::ToString() const
|
|
{
|
|
char tmp[(1 + 32) * 2] = {0};
|
|
std::string str = Base32Encode(*this, tmp);
|
|
return str + ".loki";
|
|
}
|
|
|
|
bool
|
|
Address::FromString(const std::string& str)
|
|
{
|
|
auto pos = str.find(".loki");
|
|
if(pos == std::string::npos)
|
|
return false;
|
|
auto sub = str.substr(0, pos);
|
|
return Base32Decode(sub, *this);
|
|
}
|
|
} // namespace service
|
|
} // namespace llarp
|