mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Initial commit
This commit is contained in:
commit
6c7efdd0f6
59 changed files with 8604 additions and 0 deletions
25
src/Destination.h
Normal file
25
src/Destination.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#pragma once
|
||||
|
||||
#include <MeshCore.h>
|
||||
#include <Identity.h>
|
||||
|
||||
namespace mesh {
|
||||
|
||||
/**
|
||||
* \brief Represents an end-point in the mesh, identified by a truncated SHA256 hash. (of DEST_HASH_SIZE)
|
||||
* The hash is either from just a 'name' (C-string), and these can be thought of as 'broadcast' addresses,
|
||||
* or can be the hash of name + Identity.public_key
|
||||
*/
|
||||
class Destination {
|
||||
public:
|
||||
uint8_t hash[MAX_HASH_SIZE];
|
||||
|
||||
Destination(const Identity& identity, const char* name);
|
||||
Destination(const char* name);
|
||||
Destination(const uint8_t desthash[]) { memcpy(hash, desthash, MAX_HASH_SIZE); }
|
||||
Destination();
|
||||
|
||||
bool matches(const uint8_t* other_hash);
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue