Fairness

Dice

$result_seed = hash_hmac('sha512', $server_seed, $client_seed.'-'.$nonce);
$result_number = hexdec(substr($result_seed,0,10));
$lucky_number = $result_number % 10000;
		
return $lucky_number;

Mines

$server_seed = 'server_seed_here';
$client_seed = 'client_seed_here';
$nonce = 'nonce_seed_here';

$mines_no = number of mines;
$numbers = array();
$n = 0;
while(count($numbers) < $mines_no){
	$result_seed = hash_hmac('sha512', $server_seed, $client_seed.'-'.$nonce.'-'.$n);
	$result_number = hexdec(substr($result_seed,0,10));
	$lucky_number = abs(substr($result_number,-4))%26;
	if($lucky_number != 0 && !in_array($lucky_number, $numbers)){

		$numbers[] = $lucky_number;
		
	}
	$n++;
}

print_r($numbers);

Towers

$numbers = [];

$blocks_req = 8;
$divider 	= 3;
$mines_req 	= 1;

if($difficulty == 2){
	$divider = 2;
}

if($difficulty == 3){
	$blocks_req = 16;
	$mines_req 	= 2;
}

$n 			= 0;
$row 		= 1;
$blocks 	= 0;

$server_seed = 'server_seed_here';
$client_seed = 'client_seed_here';
$nonce = 'nonce_seed_here';

while($blocks < $blocks_req){
	$result_seed	= hash_hmac('sha512', $server_seed, $client_seed.'-'.$nonce.'-'.$n);
	$result_number 	= hexdec(substr($result_seed,0,10));
	$lucky_number 	= abs(substr($result_number,-4))%$divider;

	if(!isset($numbers[$row])){
		$numbers[$row] = [];
	}

	if(!in_array($lucky_number, $numbers[$row])){

		$numbers[$row][] = $lucky_number;

		if(sizeof($numbers[$row]) == $mines_req && $blocks != $blocks_req){
			$row++;
		}

		$blocks++;
		
	}

	$n++;
}

print_r($numbers);

Slots

for ($s=1; $s < 16; $s++) { 
  $rand_item = $this->rand($server_seed, $client_seed, $nonce.'-'.$nonce_2 , $rand_up);
  foreach ($get_items as $key => $value) {

	  if(in_array($rand_item, $value)){
	  	  return $key;
	  }

  }
}

function rand($server_seed, $client_seed, $nonce, $rand_up){
		
	$result_seed = hash_hmac('sha512', $server_seed, $client_seed.'-'.$nonce);
	$result_number = hexdec(substr($result_seed,0,10));
	$lucky_number = $result_number % $rand_up;
		
	return $lucky_number;
		
}

Limbo

		$seed = hash_hmac('sha512', $server_seed, $client_seed.'-'.$nonce);

		$seed = substr($seed, 0, 52 / 4);
		$number = hexdec($seed) / pow(2, 52);

		$multiplier = floor(95 / (1 - $number)) / 100;

		return max(1, min($multiplier, 1000000));