mirror of https://github.com/oxen-io/lokinet
more hive things
DHT PubIntroSentEvent some helper functions added to RouterHive (C++ class) as well as RouterHive(Python class) hive.py main() continues to be a testbed for new event types some more internal classes in pybindpull/1184/head
parent
6d472d2423
commit
695784b2b6
@ -0,0 +1,26 @@
|
||||
#include <dht/key.hpp>
|
||||
|
||||
#include "common.hpp"
|
||||
#include <pybind11/operators.h>
|
||||
|
||||
namespace llarp
|
||||
{
|
||||
namespace dht
|
||||
{
|
||||
void
|
||||
DHTTypes_Init(py::module& mod)
|
||||
{
|
||||
py::class_< Key_t >(mod, "DHTKey")
|
||||
.def(py::self == py::self)
|
||||
.def(py::self < py::self)
|
||||
.def(py::self ^ py::self)
|
||||
.def("distance", [](const Key_t* const lhs, const Key_t* const rhs) {
|
||||
return *lhs ^ *rhs;
|
||||
})
|
||||
.def("ShortString", [](const Key_t* const key) {
|
||||
return llarp::RouterID(key->as_array()).ShortString();
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace llarp::dht
|
||||
} // namespace llarp
|
Loading…
Reference in New Issue