1
0
mirror of https://github.com/danog/PrimeModule.git synced 2024-11-26 20:34:37 +01:00

Smore fixes

This commit is contained in:
danogentili 2017-02-25 13:59:46 +03:00
parent b82d23143e
commit 897028acac
3 changed files with 2 additions and 6 deletions

View File

@ -28,7 +28,7 @@ This library has 4 prime factorization modules (ordered by speed, huge semiprime
* wolfram - A [wolfram alpha](https://wolframalpha.com) module (usually takes around 2.1294961380959 seconds calculated using 100 huge semiprimes)
* native - A [native PHP lopatin](https://github.com/LonamiWebs/Telethon/blob/master/telethon/crypto/factorizator.py) module (usually takes around 2.5698633241653 seconds calculated using 100 huge semiprimes, may sometimes be faster than the wolfram module)
* native - A [native PHP lopatin](https://github.com/LonamiWebs/Telethon/blob/master/telethon/crypto/factorizator.py) module (usually takes around 2.5698633241653 seconds calculated using 100 huge semiprimes, may sometimes be faster than the wolfram module: for example on HHVM native factorization usually takes 0.1 seconds)
These modules can be used either in the single variant, which returns only one factor (useful for semiprime factorization), or the full methods, that return an array with all of the factors.

View File

@ -101,11 +101,6 @@ class StructTools
'H' => strlen(pack($this->NATIVE_FORMATS['H'], 700)),
'i' => strlen(pack($this->NATIVE_FORMATS['i'], 1)),
'I' => strlen(pack($this->NATIVE_FORMATS['I'], 1)),
'l' => strlen(pack($this->NATIVE_FORMATS['l'], -700)),
'L' => strlen(pack($this->NATIVE_FORMATS['L'], 700)),
'q' => $this->IS64BIT ? strlen(pack($this->NATIVE_FORMATS['q'], 700)) : 8,
'Q' => $this->IS64BIT ? strlen(pack($this->NATIVE_FORMATS['Q'], 700)) : 8,
// Floating point formats
'f' => strlen(pack($this->NATIVE_FORMATS['f'], 2.0)),
'd' => strlen(pack($this->NATIVE_FORMATS['d'], 2.0)),

View File

@ -83,6 +83,7 @@ function gen_payload()
return chr(10).str_repeat(chr(0), 8).\danog\PHP\Struct::pack('<q', (int) (time() << 32)).pack('VV', 20, 1615239032).random_string(16);
}
echo PHP_EOL.'----------- HUGE SEMIPRIME TESTS (100 semiprimes) ----------'.PHP_EOL;
$GLOBALS['medium'] = ['python' => 0, 'python_alt' => 0, 'wolfram' => 0, 'native' => 0];
$tg = fsockopen('tcp://149.154.167.40:443');