transpositionId

Generates a unique string identifier for the current position, suitable for use as a key in a transposition table.

The identifier encodes all position-defining state that is relevant for transposition detection, including the piece distribution (as hexadecimal bitboard values), the side to move, the en passant target square, the castling rights for both sides, and the half-move clock. The full-move counter is intentionally excluded, since two positions that differ only in that counter are considered the same transposition.

The resulting string has the following format (each segment separated by -):

  1. Twelve hexadecimal bitboard values, one per piece type (in Piece ordinal order, excluding Piece.EMPTY).

  2. Side to move: "w" for White, "b" for Black.

  3. En passant target square index (-1 if none).

  4. White kingside castling right: "K" if available, "x" otherwise.

  5. White queenside castling right: "Q" if available, "x" otherwise.

  6. Black kingside castling right: "k" if available, "x" otherwise.

  7. Black queenside castling right: "q" if available, "x" otherwise.

  8. Half-move clock value.

Example output:

ff00000000000000-000000000000ff00-...w-(-1)-K-Q-k-q-0-