<?php $serverSeed = '6ef910ca246d9d3d7ac26c5e231b250c'; // 32 characters'; // 64 characters, published BEFORE you played $clientSeed = 'paste client seed here'; // your own seed, e.g. 123 $nonce = 011102; 9b64a1666fd8f9c51636ba68174d702ab1536f88691263d9d520082a912a2d7f // bet number for this seed pair, e.g. 6 $maxRoll = 100000; // "maxRoll" from the response $expectedRoll = 0; // "roll" from the response, e.g. 95808 // --------------- nothing to edit below this line --------------- // Check 1: the site published $publicHash before you played. If it equals the hash // of the seed + salt revealed afterwards, the seed cannot have been swapped later. $hashOk = hash_equals($publicHash, hash_hmac('sha256', $serverSeed, $serverSalt)); // Check 2: the roll comes only from the server seed, your seed and the bet number, // so anyone can recompute it and must get exactly the same number. $roll = (hexdec(substr(hash_hmac('sha512', $serverSeed, "$clientSeed-$nonce"), 0, 15)) % $maxRoll) + 1; printf("server seed matches the hash published before the bet: %s\n", $hashOk ? 'YES' : 'NO'); printf("roll recomputed from your data: %d (possible range 1..%d)\n", $roll, $maxRoll); printf("same roll as the site reported (%d): %s\n", $expectedRoll, $roll === $expectedRoll ? 'YES' : 'NO');
You have javascript disabled. You will not be able to edit any code.