Hello all! We're back again prepping another game before our launch. The game for this seeding event will be our original game Crash V2
As usual, we've generated a new chain of 10,000,000 SHA256 hashes where each hash is the hash of the hexadecimal representation of the previous hash. Being the last hash in the chain: 628042d5f25e062f24bfdd5b696c34e66a39af9b9381dfdcd2f30d0fa521545d
const { createHmac } = require('crypto');
const divisible = (hash, mod) => {
// So ABCDEFGHIJ should be chunked like AB CDEF GHIJ
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 === 0;
};
const calculateCrashPointFromHash = function (hash) {
// In 1 of 15 games the game crashes instantly.
if (divisible(hash, 15)) return 0;
// Use the most significant 52-bit from the hash to calculate the crash point
let h = parseInt(hash.slice(0, 52 / 4), 16);
let e = Math.pow(2, 52);
return (Math.floor((100 * e - h) / (e - h)) / 100).toFixed(2);
};
// these will be the 10M pre generated rolls to be used
const hashChain = ['random1', 'random2'];
const gameHash = hashChain.pop();
const blockHash = '';
const hash = createHmac('sha256', gameHash).update(blockHash).digest('hex');
const crashPoint = calculateCrashPointFromHash(hash);
console.log({ crashPoint });
We’re gonna be using a BlockHash that hasn’t been mined at the time of this post, we’re expecting to use Bitcoin block 849,840 this to prove we have no influence over the outcome of the game. Please guys feel free to quote this post so this will be all set in stone.
Looking forward to show you guys Crash V2 very soon!