NACHWEISLICH FAIR

RAFFLESSPIELERULETTECRASHJACKPOT

Sobald der 15-Sekunden-Countdown endet, berechnen wir das Crash-Ergebnis, das eine Zahl zwischen 1,00 und 9999,00 darstellt. Dieser Wert ist der Multiplikator, bei dem das Spiel abstürzt. Es besteht eine 3%ige Wahrscheinlichkeit, dass das Spiel sofort abstürzt.

Sobald dieser Multiplikator erreicht ist, wird ein Signal gesendet, das die aktuelle Runde beendet.

import crypto from "crypto";const serverSeed = "1234";const publicSeed = "abcd";const nonce = 3;const seed = `CRASH-${serverSeed}-${publicSeed}:${nonce}`;const multiplier = getCrashTick(seed);console.log("El resultado del crash es", multiplier);function getCrashTick(seed) {const hash = crypto.createHmac("sha256", seed).digest("hex");// 3 de cada 100 rondas crashean al instanteif (divisible(hash, 100) < 3) return 1;const h = Number.parseInt(hash.slice(0, 52 / 4), 16);const e = Math.pow(2, 52);const multiplier = Math.floor(((e - h / 50) / (e - h)) * 100) / 100;return Math.min(9999, multiplier);}function divisible(seed, mod) {let val = 0;let o = hash.length % 4;for (let i = o > 0 ? o - 4 : 0; i < hash.length; i += 4) {val = ((val << 16) + parseInt(hash.substring(i, i + 4), 16)) % mod;}return val;}