BASE does not allow multiple items to have one distinct hash. The intention is to allow automatic searches and matching for a set of files or even directory structures. The following intends to add hash sets.
The file list need to be modified to be able to contain a hash set attribute. Hashes are used similarly as for files with a TTH attribute (if TTH is the chosen algorithm), but named “hashset”. The previously negotiated hash method should be assumed. That means that the Directory element may contain a ‘hashset’ attribute and the File element may contain a ‘hashset’ attribute. If file list size is a worrysome matter, simply “set” should be used.
There are various ways a hash set can be created from;
- Selected files’ names concatenated.
- Selected files’ names and their absolute paths concatenated (in terms of path in the directory tree of the file list).
- Selected files’ hashes concatenated.
- Selected files’ content concatenated.
- Random generated data.
- Combination of above items.
Now, while these items will surely create enough unique content to base the hash set, some are more practical than others. If the set shall be part of a Directory, “selected files” above are to be treated as “the files in the directory” as well as “directory name”.
- Likely to be unique with a sufficiently high grade, especially in a high amount of files.
- While more unique than previous item, it may be inaccurate if two users have the two files “file1.txt” and “file2.txt” if the former have the files at “shared/text” and the other user have the files at “downloaded/text”.
- Likely to be more unique than item 1, as these values are based on the files’ content.
- While likely to be as likely as item 3, not viable to (re-)hash that much content.
- Not likely to be unique unless a good seed is used. The random range need to be sufficiently large to generate a trustworthy hash.
- Items 1, 3 and 4 are likely to be similar in their uniqueness (or at least only slighy variations). Therefore, it is unlikely that any combination will yield a better unique hash.
It seems items 1, 3 and 4 are similarly unique. Item 4 is likely not to be used due to its ineffciancy. Choosing between item 1 and 3 should yield a better unique base data when selecting item 3. Therefore;
Selected files’ hashes shall be concatenated.