mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-20 17:59:50 +00:00
wip
This commit is contained in:
17
test/xor.cpp
17
test/xor.cpp
@ -68,12 +68,9 @@ int main() {
|
||||
q = x2.reconcile(q, have, need);
|
||||
|
||||
// q and have are returned to client
|
||||
for (auto &id : have) {
|
||||
std::cout << "xor,2,HAVE," << to_hex(id) << "\n";
|
||||
}
|
||||
for (auto &id : need) {
|
||||
std::cout << "xor,2,NEED," << to_hex(id) << "\n";
|
||||
}
|
||||
for (auto &id : have) std::cout << "xor,2,HAVE," << to_hex(id) << "\n";
|
||||
for (auto &id : need) std::cout << "xor,2,NEED," << to_hex(id) << "\n";
|
||||
|
||||
std::cerr << "HAVE " << (have.size() * idSize) << " bytes "
|
||||
<< "NEED " << (need.size() * idSize) << " bytes " << std::endl;
|
||||
}
|
||||
@ -85,12 +82,8 @@ int main() {
|
||||
std::vector<std::string> have, need;
|
||||
q = x1.reconcile(q, have, need);
|
||||
|
||||
for (auto &id : need) {
|
||||
std::cout << "xor,1,NEED," << to_hex(id) << "\n";
|
||||
}
|
||||
for (auto &id : have) {
|
||||
std::cout << "xor,1,HAVE," << to_hex(id) << "\n";
|
||||
}
|
||||
for (auto &id : have) std::cout << "xor,1,HAVE," << to_hex(id) << "\n";
|
||||
for (auto &id : need) std::cout << "xor,1,NEED," << to_hex(id) << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,8 @@
|
||||
use IPC::Open2;
|
||||
use Session::Token;
|
||||
|
||||
my $idSize = 16;
|
||||
my $harnessCmd = shift;
|
||||
my $idSize = shift || 16;
|
||||
|
||||
srand($ENV{SEED} || 0);
|
||||
my $stgen = Session::Token->new(seed => "\x00" x 1024, alphabet => '0123456789abcdef', length => $idSize * 2);
|
||||
@ -13,7 +14,7 @@ while(1) {
|
||||
my $ids1 = {};
|
||||
my $ids2 = {};
|
||||
|
||||
my $pid = open2(my $outfile, my $infile, './test/xor');
|
||||
my $pid = open2(my $outfile, my $infile, $harnessCmd);
|
||||
|
||||
my $num = rnd(10000) + 1;
|
||||
|
||||
|
Reference in New Issue
Block a user