solanaceae_toxcore/solanaceae/toxcore/tox_interface.cpp

17 lines
429 B
C++
Raw Normal View History

#include <tox/tox.h> // before interface
2023-04-08 00:13:28 +02:00
#include "./tox_interface.hpp"
2024-01-13 22:54:38 +01:00
#include <solanaceae/util/utils.hpp>
2023-04-08 00:13:28 +02:00
std::string ToxI_raw::toxSelfGetAddressStr(void) {
// TODO: cache
return bin2hex(toxSelfGetAddress());
}
std::vector<uint8_t> ToxI_raw::toxHash(const std::vector<uint8_t>& data) {
std::vector<uint8_t> hash(TOX_HASH_LENGTH);
tox_hash(hash.data(), data.data(), data.size()); // TODO: return value?
return hash;
}