Is the Zha Jin Hua Shuffle Truly Random? Why?
Seeds come from the operating system, ChaCha20 expands them and a rejection-sampling Fisher–Yates shuffle stays unbiased. 200,000 hands from the server’s own shuffle-and-deal functions match the theoretical odds. Also covers why good hands still feel common.
Learn by playing: open Zha Jin Hua in your browser, no download needed.
Play Zha Jin HuaShort answer: every BluffKing Zha Jin Hua hand takes its random seed from the operating system’s secure random source, and a cryptographic random number generator expands that seed into the numbers the shuffle uses. Strictly speaking that is “cryptographically secure pseudo-randomness”, the same kind banks and encrypted connections rely on. As long as the seed stays secret, no practical method can tell it apart from true randomness. The shuffle algorithm also avoids the usual sources of bias. We dealt 200,000 hands with the same shuffle-and-deal functions the server uses, and every hand category appeared at its mathematical rate.
- Unguessable seed: 256 bits per hand from the operating system, never the time, an account or a table number.
- Unbiased algorithm: a Fisher–Yates shuffle that picks each position by rejection sampling, so there is no “remainder” bias.
- Measured match: 200,000 hands each dealt for standard and joker rooms, with the standard hands also re-scored under wild rules; every category stays within normal sampling noise.
- Why good hands feel common: table size, which hands get shown, and wild rules. Section 4 has the numbers.
1. What is the difference between “true” and “pseudo” random?
Most random numbers in a computer are pseudo-random: an algorithm starts from a value (the seed) and computes a long sequence that looks chaotic. The same seed always gives the same sequence, so pseudo-randomness itself is not the danger. These three mistakes are:
- A guessable seed. If the seed is the current time, anyone who guesses the time can rebuild the whole deck.
- A predictable algorithm. The default random function in many programming languages can be predicted after seeing part of its output.
- A biased shuffle. Written the wrong way, a shuffle makes some deck orders more likely than others.
This is not hypothetical. In 1999 security researchers published a flaw in an online poker site’s shuffle: it seeded with the milliseconds since midnight, leaving only tens of millions of possible decks, and the shuffle itself was biased. Knowing just their two hole cards and the first three community cards, the researchers could compute the entire deck. So the useful question is not just “is it truly random?” but “are any of these three doors open?”
2. How BluffKing’s Zha Jin Hua handles each one
- Seed: fresh every hand. Before each hand the server asks the operating system for 32 bytes (256 bits) of randomness as that hand’s master seed. The operating system keeps mixing in noise from hardware and system events, and no programmer can choose its output. The seed contains no time, account, membership level, chips or win/loss history. The hand ID and seat list (in joker rooms also a fingerprint of the hand’s roster) are hashed in only as labels binding the proof to that hand; they add no randomness and cannot steer cards.
- Generator: ChaCha20. The seed is hashed and handed to ChaCha20, a cryptographic algorithm also widely used in HTTPS. Without the seed, seeing every earlier output still does not let you predict the next number.
- Shuffle: unbiased Fisher–Yates. Starting from the last card, each step swaps it with a randomly chosen card among those not yet placed. Choosing that position has a classic trap: taking a random number modulo 52 makes small remainders slightly more likely, because the random number’s range is usually not a multiple of 52. Our code throws away any number that lands in that leftover slice and draws again. This is called rejection sampling, and it makes every position exactly equally likely.
- A long enough seed. A 52-card deck has 52! orders, about 2 to the power 226. A 256-bit seed has 2 to the power 256 values, far more than the number of deck orders, so a short seed cannot leave most orders unreachable.
- Two layers. The server first shuffles with the master seed, encrypts and locks the deck, and publishes its “fingerprint”. Then the browser of each human player in the hand contributes a random number, and those numbers together with the fingerprint decide which locked card goes to whom, using the same unbiased shuffle. Neither layer reads who a player is or how they have been doing. For the full flow and who can see which cards, see Is Zha Jin Hua dealing fair?
Joker rooms add the two jokers for 54 cards and use a different dealing proof; their seed also comes from the operating system and their shuffle is equally unbiased. Wild-rank rooms (one rank is wild) still use the ordinary 52 cards; only the comparison treats the wild cards as anything.
3. Measured: hand categories over 200,000 hands
On 18 November 2026 we called the same shuffle-and-deal functions the server uses (the open-source mental-poker crate) on a local machine: ten seats per deal, a fresh operating-system seed for every deal, three simulated player random numbers, 20,000 deals and so 200,000 three-card hands. The table puts the measured share next to the mathematical one (the theory counts every possible three-card combination: 22,100 in a standard deck). Wild-rank rooms deal from the same 52-card code, so the wild-7 column re-scores the same 200,000 hands; the joker column is a separate 200,000.
| Category | Standard: measured / theory | Wild 7s: measured / theory | Jokers: measured / theory |
|---|---|---|---|
| Leopard (three of a kind) | 0.22% / 0.24% | 2.82% / 2.84% | 1.02% / 1.05% |
| Straight flush | 0.22% / 0.22% | 1.70% / 1.68% | 0.94% / 1.00% |
| Flush | 4.90% / 4.96% | 6.96% / 7.08% | 6.08% / 6.13% |
| Straight | 3.35% / 3.26% | 7.07% / 7.00% | 5.39% / 5.32% |
| Pair | 17.00% / 16.94% | 24.21% / 24.11% | 20.30% / 20.22% |
| High card | 74.31% / 74.39% | 57.23% / 57.29% | 66.27% / 66.28% |
How do you tell whether a gap matters? A chi-square test gives a bigger number the less random the data looks. The three rooms score 8.6, 7.0 and 11.2, all below 15.1, the line where a result this uneven would happen by chance only 1% of the time. In other words, the gaps are ordinary sampling noise. We also checked whether all 52 cards are equally common at each dealing position: across 30 positions the chi-square averages 51.7, right at the value of 51 expected from random dealing, and the largest, 75.3, is below the alarm line of about 88. No card favours any seat.
These numbers test the dealing code itself. We have counted real games too: across 11,397 Zha Jin Hua hands up to 29 October 2026, the leopard rate matched theory; see the two-leopards-in-five-hands check.
4. So why do good hands feel so common?
- More players, more chances. Your own chance of a flush or better is about 5.4%, but every extra player at the table is another chance. These figures come from simulating 200,000 random deals:
At a ten-player table, more than four hands in ten have someone holding a flush or better.
Players Someone has a straight or better Someone has a flush or better Someone has a leopard 2 16.6% 10.6% 0.47% 6 41.9% 28.3% 1.40% 10 59.6% 42.7% 2.31% - The hands you see are mostly good ones. Weak hands are usually folded early and never shown. The hands that reach a compare or showdown are the ones strong enough to keep paying. The opponents’ cards you see have already been filtered, so of course they look big.
- Wild and joker rooms are built for big hands. In the table above, wild 7s produce leopards about 2.84% of the time, twelve times the standard rate; joker rooms about 1.05%, more than four times. Leopards everywhere in those rooms are the game design, not a broken shuffle.
- Big hands are memorable. A leopard or straight flush that wins alone is shown to the table, and in rooms with the bonus it collects from everyone, so it sticks. A run of high-card hands is forgotten at once.
Random also does not mean luck evens out. Several weak hands in a row, or an opponent hitting big hands back to back, both happen with random dealing; they just happen less often.
5. What you can check yourself
- Verify a hand. Open “Records” from the table menu, go to “Hand history”, pick a hand and tap “Verify deal” under “Deal proof”. Verification runs on your own device and opens only cards you were already allowed to see. For the steps and how to read the result, see this section.
- Read the source. The code is public at github.com/CisaSettle/bluffking: the random number generator is in
engine/src/rng.rs, the rejection-sampling shuffles inengine/src/deck.rsandmental-poker/src/crypto_real/shuffle.rs, and the locked deck and dealing order inmental-poker/src/pf2.rs.
6. Dealing proofs and device records
A random shuffle does not mean the server cannot know the cards: during a hand the server has to decide who wins a compare, so it knows the cards. Per-hand verification shows the deck was not picked in advance or swapped afterwards, but under conditions, for example that a human random number arrived in time and that the browser you played on still keeps the opening record (up to 30 days). When no human random number arrives, the order depends only on the server’s seed. The full list of limits is in Is Zha Jin Hua dealing fair? · who can see cards and how verification works.
If cards in a proof do not match, or a hand category seems clearly off, note the hand ID and time and tell us through in-app feedback.