Spunk Odds Reference

Hi-lo guide

Sapphire Hi-lo: checking one card draw by hash

Sapphire here is only the page's name, carried over from an earlier version of the site, and it implies no special rules. The page walks through one hash-verified hi-lo draw, line by line, with every value computed in code.

The inputs

In a common construction, three inputs fix each card. The server seed is a secret chosen by the service. The client seed is a string the player can set. The nonce is a counter that goes up by one for each draw. For this example the server seed is sapphire-srv-41c9e2, the client seed is sapphire-player-07, and the nonce is 33.

One hi-lo card from seeds sapphire-srv-41c9e2 / sapphire-player-07, nonce 33
Server seed (revealed later)sapphire-srv-41c9e2
Commitment shown before play: SHA-256(server seed)6e401c752211394c99e65d7f2abcaf271b8c88ae17c74ae4ba582150b67bc856
Client seed : nonce : roundsapphire-player-07:33:0
HMAC-SHA256(server seed, message)61c8a690938c054034fb3495c43d39941d9c071f2dd38eb80b1c856c458c158f
First 4 bytes (8 hex digits)61c8a690 = 1,640,539,792
Float = value / 2^320.3819679357
Rank = floor(float x 13) + 15 (rank 5)

One common construction, shown for teaching. Real services document their own message format; check theirs before verifying.

Line by line

  1. Before any card is dealt, the service shows SHA-256 of the server seed: 6e401c752211394c.... The seed itself stays hidden.
  2. After the seed is revealed, hash it yourself. If your result does not match the commitment exactly, stop: the seed is not the one that was committed.
  3. Build the message sapphire-player-07:33:0 and compute HMAC-SHA256 with the server seed as the key. The digest starts 61c8a690.
  4. Read those first 8 hex digits as a whole number and divide by 2^32. That gives a float between 0 and 1.
  5. Multiply the float by 13, round down, and add 1. The result is the card rank, from Ace (1) to King (13).

Turning the card into a result

The hash fixes the card, not the outcome of a call. Suppose the previous face card was a 6 and the call was higher. That call wins on 7 through King, which is 53.85% of ranks. The drawn rank above is 5, so against a 6 that call is a loss. The tie rule matters here: it must be stated before the draw, because it decides what happens when the ranks match.

What the check proves