#!/usr/bin/env php 0, 'python_alt' => 0, 'wolfram' => 0, 'native' => 0]; $tg = fsockopen('tcp://149.154.167.40:443'); fwrite($tg, chr(239)); stream_set_timeout($tg, 1); $tot = 100; for ($x = 0; $x < $tot; $x++) { fwrite($tg, gen_payload()); $number = \danog\PHP\Struct::unpack('>q', substr(stream_get_contents($tg, 85), 58, 8))[0]; test_single($number); } fclose($tg); foreach ($medium as $type => $total) { echo $type.': total time '.$total.', medium time '.($total / $tot).PHP_EOL; } echo PHP_EOL.'------------------- SMALL MULTIPLE FACTOR TESTS -------------------'.PHP_EOL; $GLOBALS['medium'] = ['python' => 0, 'python_alt' => 0, 'wolfram' => 0, 'native' => 0]; foreach ([200, 327, 35, 13589] as $multiple) { test($multiple); } foreach ($medium as $type => $total) { echo $type.': total time '.$total.', medium time '.($total / 4).PHP_EOL; } echo PHP_EOL.'------------------- HUGE SEMIPRIME TESTS (MESSY) ------------------'.PHP_EOL; $GLOBALS['medium'] = ['python' => 0, 'python_alt' => 0, 'wolfram' => 0, 'native' => 0]; $m = [1724114033281923457, 2189285106422392999, 3510535493073971807, 1756377470921216651, 1767867620107504387, 2149465210997855797]; foreach ($m as $messy) { test_single($messy, true); } foreach ($medium as $type => $total) { echo $type.': total time '.$total.', medium time '.($total / count($m)).PHP_EOL; }