ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > N.A.N.Y. 2020

Polyglot Zobrist Key Generator


When writing a chess engine, you might want to support opening books in Polyglot bin format. This format creates the hash for the position using Zobrist hashing. If you want to debug your hash generator, I haven't found any services that can generate hash from the position.
So I wrote one. You paste the position as FEN and get the resulting hash.


Wow, this is beyond my level to use, but I'm psyched to see a Chess Nany Entry!

I did a PGN processor and got mouser's permission because it was custom commissioned and not shared elsewhere.

Some notes for the DC Crowd:

- FEN stands for "Forsyth Edwards Notation", which is a text way to describe a position in chess. The basic idea is line by line, it contains data like "Rook, 2 spaces Queen 2 spaces King / Next Line" and some notes like whose move it is and whether things like castling or en passant are legal.

- An "Opening book" means a chess program first looks for known positions in its "book" or library, to see what might be a good move to try, rather than trying to figure it out from scratch. The basic idea is that for a set position, "there's a severe risk the computer won't understand to do x or y as good choices, but instead plays move Q which leads to a bad or even losing position".  So I think I understand this Nany to add misc positions themselves into the book. So I think the Caro Kann opening has some famous endgame, and you could put that in there, so even if it didn't have twenty hours of work with the full move set to get there, suddenly if the computer spots that the specific position showed up, "oh, I should do this here".


My intended use is much simpler.
When you're writing an engine, most opening books are in the Polyglot format (.bin). The positions in the book are encoded with Zobrist hashing ( So to check if the position is present in the book, you first need to hash it. And because Murphy's law states that "it's bug-ridden and broken from the start", you need to debug your hashing somehow, ideally comparing with some other generator.
I couldn't find anything to debug my hashing while writing Mussaurus (, so I wrote my own generator.


[0] Message Index

Go to full version