<commit_before># merkle-stream

Construct a merkle tree and compare with remote tree via duplex stream.

And compare it with remote tree via duplex streams.
This module is a building block for creating secure replication protocols.

[![travis](https://travis-ci.org/dominictarr/pull-merkle.png?branch=master)
](https://travis-ci.org/dominictarr/pull-merkle)

[![testling](http://ci.testling.com/dominictarr/pull-merkle.png)
](http://ci.testling.com/dominictarr/pull-merkle)

## License

MIT<commit_msg>notes<commit_after># merkle-stream

Construct a merkle tree and compare with remote tree via duplex stream.

And compare it with remote tree via duplex streams.
This module is a building block for creating secure replication protocols.

[![travis](https://travis-ci.org/dominictarr/pull-merkle.png?branch=master)
](https://travis-ci.org/dominictarr/pull-merkle)

[![testling](http://ci.testling.com/dominictarr/pull-merkle.png)
](http://ci.testling.com/dominictarr/pull-merkle)

## next steps

measure performance of replication, under different factors.
take a large dataset, with varying differences (between replicators)
compare sets that are mostly the same, mostly different, and half different.
graph performance (time, bandwidth) as the proportion changes.

Then, implement other strategies.
I suspect that a merkle tree is ideal when you have a large amount of overlap,
but you don't know where it is.

For example, compare with just sending the entire list of hashes,
this will be much simpler, and I think this may work better when the intersection is small.
It may also mean less round-trips. If one side only has a handful of items,
then it might be faster to just send everything they have.

okay, so the first phase... is to implement a benchmark on the handshake.
## License

MIT
{'fraction_non_alphanumeric': 0.08908685968819599, 'fraction_numerical': 0.0, 'mean_word_length': 4.778135048231511, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1103199', 'n_tokens_mistral': 517, 'n_tokens_neox': 522, 'n_words': 211}