HGRS

Test environment (dev). This copy of HGRS’s pages serves its dev test app.

How the drawing works

When a challenge is over, its organizer runs one drawing that picks names at random from all its entries. Anyone can check the result.

Names were picked at random from all valid entries. Each entry counted once, and nobody could be picked twice.

Who is in it

The method, steps.draw.v1

  1. The list. Every entry is one line: the participant's code, which starts with prt_ and holds no name, a space, and the day, such as prt_01JF… 2026-12-01. The lines are sorted byte by byte and each ends with a line feed. The list's SHA-256, in hex, is its entries hash.
  2. The seed. When the organizer runs the drawing, the server takes 32 random bytes from its secure random generator. They are kept with the result.
  3. The numbers. Block c is HMAC-SHA256 keyed with the seed over the text steps.draw.v1, one zero byte, the 32 bytes of the entries hash and c as four bytes, most significant first, for c = 0, 1, 2 and so on. Each block gives four 64-bit numbers, most significant byte first, read in order.
  4. The picks. With m lines left, take the next number. A number among the top 264 mod m values is skipped and the next one taken, so that every line is equally likely. The number's remainder after dividing by m picks one of the lines left, in their sorted order, counting the first line as 0: its person is picked, with that line's day, and all their lines leave the list, the rest keeping their order. This repeats until the names to pick are picked, or nobody is left.

The result is written once and never changes: running the drawing again shows the same result. It names people only by their codes, and HGRS shows their names beside it.

Check a drawing yourself

A challenge's results in HGRS show How this was drawn: the method, the entries hash and the seed. With the list of entries, anyone can follow the steps above and get the same names in the same order. Our checker is one short program that needs only Node.js. Write to support@systemthinkvan.com for a copy, or write your own from this page.