How the result is calculated
- Before you spin
We generate a secret seed and show you its SHA-256 hash. Save that hash: it is our commitment to the seed for your next spin.
- One seed, one result
We combine your player ID and that seed using HMAC-SHA512. The first seven hexadecimal characters are converted to a number. The remainder after dividing by 13 gives the winning pocket, from 0 to 12.
- After the spin
The seed is revealed automatically. Check that its hash matches the one you saved, then repeat the calculation to confirm the result.
View verification code
Copy this code into a file named verify.cjs. Enter the values for your spin and run node verify.cjs using Node.js. Both checks should print true.
const crypto = require('node:crypto');
// Replace these values with the spin you want to verify.
const playerId = "YOUR_PLAYER_ID";
const serverSeed = "REVEALED_SERVER_SEED";
// Use the hash you saved BEFORE this spin.
const savedHash = "YOUR_SAVED_HASH";
const expectedResult = Number("SPIN_RESULT");
const hash = crypto.createHash('sha256')
.update(serverSeed, 'utf8').digest('hex');
const digest = crypto.createHmac('sha512', playerId)
.update(serverSeed, 'utf8').digest('hex');
const result = parseInt(digest.slice(0, 7), 16) % 13;
console.log({
commitmentMatches: hash === savedHash,
result,
resultMatches: result === expectedResult,
});