Post
Topic
Board Gambling
Re: 🔥🎲Luckydice.com 🎲🔥 - ⭐ 100,000 USD Jackpot ⭐ Cashback ⭐ Faucet ⭐ Unique Game ⭐️
by
luckydice.com
on 03/02/2020, 18:06:48 UTC
I was also confused by little to zero impact on final result from byte third and forth.
Yes, even the second byte has very little effect.
The first term (a/256) is a value between 0 and 0.996, while other three terms (b/2562)+(c/2563)+(d/2564) totally cannot exceed 0.004. They are used for making the game completely fair.

For example if the first decimal is between 0 and 41 the outcome will be 1 and other three decimals don't matter. If the outcome is between 43 and 84 the outcome will be 2.
Only if the first decimal is 42, then the second term will determine whether the final outcome to be one or two

Thanks for help in fairness calculations, we use same random number generator for both types of dices (classic and digital), bonus games, for BitKong and for upcoming games, this is why it use 4 bytes to have universal RNG. Soon we will add code snippet to fairness section. Please see RNG code below:

Code:
randomNumberGenerator(serverSeed, clientSeed, nonce, round) {
  let extra = 0;
  while (true) {
    const hash = Buffer.from(
      HmacSHA256(
        `${clientSeed}:${nonce}:${round}:${extra++}`,
        serverSeed
      ).toString(),
      "hex"
    );
    let cursor = 0;
    while (cursor < hash.byteLength / 4) {
      yield hash
        .slice(cursor * 4, ++cursor * 4)
        .reduce(
          (sum, byte, index) =>
            sum.add(new Decimal(byte).dividedBy(256 ** (index + 1))),
          new Decimal(0)
        );
    }
    cursor = 0;
  }
}