Last active
January 30, 2019 09:19
-
-
Save kmark/87d8c43839219fddadadd69f1bbf94fb to your computer and use it in GitHub Desktop.
Does about 15 MiB/s on my machine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
mt_srand(random_int(PHP_INT_MIN, PHP_INT_MAX)); | |
while (true) { | |
$a = []; | |
for ($i = 0; $i < 10000; $i++) { | |
$a[] = mt_rand_short(); | |
} | |
echo pack("s*", ...$a); | |
} | |
function mt_rand_short() : int { | |
return mt_rand(-2**15, 2**15 - 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment