summaryrefslogtreecommitdiff
path: root/toxcore/tox.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2017-03-26 19:23:31 +0000
committeriphydf <iphydf@users.noreply.github.com>2017-03-30 19:36:43 +0000
commitaa2310ad2a8b4e3cbe6beaf61fcf4066752a02fa (patch)
tree6128ff1b75380016018d8307a9a224f4ac852b35 /toxcore/tox.h
parentc780d25e3e08267f9c225f8d576892f771db801e (diff)
Add TOX_NOSPAM_SIZE to the public API.
Fixes #456.
Diffstat (limited to 'toxcore/tox.h')
-rw-r--r--toxcore/tox.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h
index f7724c8f..75757b6f 100644
--- a/toxcore/tox.h
+++ b/toxcore/tox.h
@@ -246,6 +246,13 @@ uint32_t tox_public_key_size(void);
246uint32_t tox_secret_key_size(void); 246uint32_t tox_secret_key_size(void);
247 247
248/** 248/**
249 * The size of the nospam in bytes when written in a Tox address.
250 */
251#define TOX_NOSPAM_SIZE (sizeof(uint32_t))
252
253uint32_t tox_nospam_size(void);
254
255/**
249 * The size of a Tox address in bytes. Tox addresses are in the format 256 * The size of a Tox address in bytes. Tox addresses are in the format
250 * [Public Key (TOX_PUBLIC_KEY_SIZE bytes)][nospam (4 bytes)][checksum (2 bytes)]. 257 * [Public Key (TOX_PUBLIC_KEY_SIZE bytes)][nospam (4 bytes)][checksum (2 bytes)].
251 * 258 *
@@ -253,7 +260,7 @@ uint32_t tox_secret_key_size(void);
253 * byte is an XOR of all the even bytes (0, 2, 4, ...), the second byte is an 260 * byte is an XOR of all the even bytes (0, 2, 4, ...), the second byte is an
254 * XOR of all the odd bytes (1, 3, 5, ...) of the Public Key and nospam. 261 * XOR of all the odd bytes (1, 3, 5, ...) of the Public Key and nospam.
255 */ 262 */
256#define TOX_ADDRESS_SIZE (TOX_PUBLIC_KEY_SIZE + sizeof(uint32_t) + sizeof(uint16_t)) 263#define TOX_ADDRESS_SIZE (TOX_PUBLIC_KEY_SIZE + TOX_NOSPAM_SIZE + sizeof(uint16_t))
257 264
258uint32_t tox_address_size(void); 265uint32_t tox_address_size(void);
259 266