0% found this document useful (0 votes)
271 views

Script Bitcoin - Hackxx

This PHP script simulates 100,000 lottery number draws and tallies the results into different prize categories. It uses hashes of randomly generated seed strings and iteration counts to generate random numbers between 0-9999 for each draw. The numbers are then counted and placed into categories like jackpots, $10k prizes, and ranges that correspond to other lower prizes. The results are output as counts in each category out of the 100,000 total draws.

Uploaded by

enoid
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
271 views

Script Bitcoin - Hackxx

This PHP script simulates 100,000 lottery number draws and tallies the results into different prize categories. It uses hashes of randomly generated seed strings and iteration counts to generate random numbers between 0-9999 for each draw. The numbers are then counted and placed into categories like jackpots, $10k prizes, and ranges that correspond to other lower prizes. The results are output as counts in each category out of the 100,000 total draws.

Uploaded by

enoid
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

<?

php
set_time_limit(360); // number of seconds to run script, default is 30

$_jackpot = $_10k_pz = $_prize1 = $_prize2 = $_prize3 = $_prize4 = $_prize5 = 0;


$tries = 100000; //Number of tires
$c=1;// Iteration count
do {
// nonce = $c;
// 12 char server seed string, 16 char client seed string
$nhash = hash_hmac('sha512',$c.':'.seed_string(12).':'.$c,
$c.':'.seed_string(16).':'.$c,false);
$_no = ceil(hexdec(mb_substr($nhash, 0, 8 ))/429496.7295);

$_jackpot += ($_no == 8888);


$_10k_pz += ($_no == 10000);
$_prize1 += ($_no >= 0 && $_no <= 9885);
$_prize2 += ($_no >= 9886 && $_no <= 9985);
$_prize3 += ($_no >= 9986 && $_no <= 9993);
$_prize4 += ($_no >= 9994 && $_no <= 9997);
$_prize5 += ($_no >= 9998 && $_no <= 9999);

$c++;
} while ($c <= $tries);
echo '<pre>
[Counts out of ', $tries, ' tries]
Jackpots: ', $_jackpot, '
10000 prize: ', $_10k_pz, '
0000-9885: ', $_prize1, '
9886-9985: ', $_prize2, '
9986-9993: ', $_prize3, '
9994-9997: ', $_prize4, '
9998-9999: ', $_prize5, '
</pre>';

function make_rand($l,$h) {
mt_srand(make_seed());
return mt_rand($l,$h);
}
function make_seed() {
list($usec,$sec) = explode(' ', microtime());
return (float) $sec + ((float) $usec * 65536);
}
function seed_string ($itr) {
$charSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
$ranStr = null;

for ($i = 0; $i < $itr; $i++) {


mt_srand(make_seed());
$ranStr[] = substr($charSet, mt_rand(0, strlen($charSet)), 1);
}
return implode($ranStr,'');
}
?>

You might also like