3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $serverSeed = '8013f9fa199afdae4dc1907040541c2ea2d7b1d1bcb120a19f35e54b2294724b682d79dd29a80c63315ccd20c42b45e56f7889541347b5115e32bdc207a58d33'; $clientSeed = '1117f2bfec3f3c94204ada1e8f927139bb52bb07792e3f8f91216ed6bee444600bb22003de6d77c1f4b2df346e43cc4bcb87'; $nonce = 1; for($nonce =40; $nonce < 50; $nonce++){ $seed = $serverSeed.'-'.$clientSeed.'-'.$nonce; do { $seed = sha1($seed); $lucky = hexdec(substr($seed,0,8)); $result_seed = hash_hmac('sha512', $serverSeed, $clientSeed); $result_number = hexdec(substr($result_seed,0,10)); } while ($lucky > 4294960000); $luckyNumber = ($lucky % 10000) / 100; if ($luckyNumber < 0) $luckyNumber = -$luckyNumber; echo $result_seed; echo $result_number; echo $nonce.":".$luckyNumber; echo nl2br ("\n"); }
based on GTAq5
Output for 5.6.0 - 5.6.30, hhvm-3.18.4 - 3.22.0, 7.0.0 - 7.3.0beta1
93e06e74342059a08d6b931c2afac8ec9f20860d72d09247b423f510e258ad932f414305d62dfdc8cd647202f0cff96f074b16616dfdcb07cafb102ecf039dd863512552760440:24.26<br /> 93e06e74342059a08d6b931c2afac8ec9f20860d72d09247b423f510e258ad932f414305d62dfdc8cd647202f0cff96f074b16616dfdcb07cafb102ecf039dd863512552760441:60.68<br /> 93e06e74342059a08d6b931c2afac8ec9f20860d72d09247b423f510e258ad932f414305d62dfdc8cd647202f0cff96f074b16616dfdcb07cafb102ecf039dd863512552760442:4.64<br /> 93e06e74342059a08d6b931c2afac8ec9f20860d72d09247b423f510e258ad932f414305d62dfdc8cd647202f0cff96f074b16616dfdcb07cafb102ecf039dd863512552760443:13.88<br /> 93e06e74342059a08d6b931c2afac8ec9f20860d72d09247b423f510e258ad932f414305d62dfdc8cd647202f0cff96f074b16616dfdcb07cafb102ecf039dd863512552760444:21.05<br /> 93e06e74342059a08d6b931c2afac8ec9f20860d72d09247b423f510e258ad932f414305d62dfdc8cd647202f0cff96f074b16616dfdcb07cafb102ecf039dd863512552760445:99.13<br /> 93e06e74342059a08d6b931c2afac8ec9f20860d72d09247b423f510e258ad932f414305d62dfdc8cd647202f0cff96f074b16616dfdcb07cafb102ecf039dd863512552760446:2.4<br /> 93e06e74342059a08d6b931c2afac8ec9f20860d72d09247b423f510e258ad932f414305d62dfdc8cd647202f0cff96f074b16616dfdcb07cafb102ecf039dd863512552760447:67.9<br /> 93e06e74342059a08d6b931c2afac8ec9f20860d72d09247b423f510e258ad932f414305d62dfdc8cd647202f0cff96f074b16616dfdcb07cafb102ecf039dd863512552760448:76.77<br /> 93e06e74342059a08d6b931c2afac8ec9f20860d72d09247b423f510e258ad932f414305d62dfdc8cd647202f0cff96f074b16616dfdcb07cafb102ecf039dd863512552760449:37.61<br />