Hashing of dice
In the beginning of each game the sequence of dice is generated and a control figure (hash code) is calculated for it (using md5 algorithm). This hash code is available for the players.
The calculated hash code has the following features:
- Its value changes very much if to change the value of at least one cube in the sequence. It is almost unreal to change the initial sequence of the dice during the game (in favour of one of players) and in addition to it, hash code didn’t change.
- Knowing hash code it is difficult to remember the initial sequence of dice in the course of a single game (and consequently to predict what dice will be rolled further).
All generated dice are registered in the game log file in the end of the single game.
The use of the given approach guarantees that the sequence of dice didn't change during the party.
Example:
DH[b87c09208b90f00776b8978c1bd41ccc]MI[length:0][game:0][ws:0][bs:0]
DS[563543244323243325453254531336524624426445133531521165134614416635533415546436224553266
351431163456613214661261341252115461346425465416414361424453224425361315642156434655626416
413145333141111616345441213512551323356565643245354112421563344365531232126565363654156555
634613654661152652465625234651225564451433433622621512245445131454422342461221315231546353
316431651541264121523543534635534533524361645534144514625432643264643411245223362113516462
124142165136516545154352566164]
In this case b87c09208b90f00776b8978c1bd41ccc is a hash of dice and 563543... 566164 is a sequence.
When playing in the Nackgammon the situation when all values of the sequence are used, is possible. Then the old sequence and its hash code are registered in the game log and a new one is generated. Its hash code is accessible when clicking on the right button. And a new sequence will be registered either after the game end or when all values are used.
On-line calculators exist for the md5 hash code calculation. These calculators can be easily found by the searches programmes in Internet. For example: http://md5-hash-online.waraxe.us/, http://www.md5.cz/
It is necessary to see the hash code value in the game course to be convinced of the dice sequence invariance (clicking the right mouse button on the game field). It must coincide with the one registered in the log file after the game end (in this case b87... ccc). Further to copy dice values from the log (in this case numbers 563543... 566164) in the calculator and to execute a calculation. The calculated value of hash code must also coincide with the one registered in the log (in this case b87... ccc).
Last change: 13.09.2010.
|