The Shuffling Algorithm
For each hand of poker, we shuffle the entire deck before any cards are dealt. This is achieved as follows:
We create an array with each of the 52 cards in order (2c, 2d, 2h, 2s, 3c... ... Ah, As). We then use the RNG to assign 32-bit random numbers (from 0 to 4,294,967,295) to each card. We then sort the array in increasing order using the number assigned to each card, generating a random permutation of the order of cards in the deck.
It is possible for more than one card to be assigned the same number, although this happens less than one time in a million. In this case, we simply throw away the deck and start again.
The poker logic then deals cards from this array, starting from the first card, as required by the poker logic (eg 2 cards to each player one at a time for hold’em, 3 for the flop, the turn and river cards – we don’t burn cards as there’s no chance of a user accidentally seeing an un-dealt card, and it makes no difference to the randomness of the shuffle).
The Random Number Generator
We use the Mersenne Twister(MT) algorithm to generate random numbers. This algorithm is detailed here.
We use this algorithm to generate our random numbers. MT is extremely fast, has statistically proven very random output (including passing the “Die Hard” test), a period of 2^19937 (approximately 10^6000), and can be seeded by a 19968 bit key.
Seeding the RNG
The RNG is regularly seeded using Microsoft’s Windows Cryptographic API. This service provides random numbers using the entropy naturally present in the physical server machines.
Independent Certification
The PKR RNG is regulary certified by an independent third party called Gaming Associates who are based in Australia. They are one of the Alderney Gambling Control Commission's accredited testing houses.