From 4c37f0c32bd22f55756c5adacf37956a9b7dac1e Mon Sep 17 00:00:00 2001 From: Green Sky Date: Sat, 14 Jan 2023 20:58:29 +0100 Subject: [PATCH] ft1 ft for actual files draft --- ngc_ft1.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/ngc_ft1.h b/ngc_ft1.h index 082588e..6f21db3 100644 --- a/ngc_ft1.h +++ b/ngc_ft1.h @@ -31,12 +31,35 @@ typedef enum NGC_FT1_file_kind /*: uint8_t*/ { // peer pub key + msg_id NGC_HS1_MESSAGE_BY_ID = 1u, // history sync PoC 1 + // id: TOX_FILE_ID_LENGTH (32) bytes + // this is basically and id and probably not a hash, like the tox friend api + // this id can be unique between 2 peers + ID = 8u, + + // id: hash of the info, like a torrent infohash (using the same hash as the data) + // TODO: determain internal format + // draft: (for single file) + // - 256 bytes | filename + // - 8bytes | file size + // - fixed chunk size of 4kb + // - array of chunk hashes (ids) [ + // - SHAX bytes + // - ] + HASH_SHA1_INFO, + HASH_SHA2_INFO, + + // id: hash of the content + // TODO: fixed chunk size or variable (defined in info) + // if "variable" sized, it can be aliased with TORRENT_VX_CHUNK in the implementation + HASH_SHA1_CHUNK, + HASH_SHA2_CHUNK, + // :) // draft for fun and profit // TODO: should we even support v1? // TODO: design the same thing again for tox? (msg_pack instead of bencode?) // id: infohash - TORRENT_V1_METAINFO = 8u, + TORRENT_V1_METAINFO, // id: sha1 TORRENT_V1_CHUNK, // alias with SHA1_CHUNK?