/** * Zobrist hashing for position identification * * Zobrist hashing provides a fast way to uniquely identify board positions * for use in the transposition table. Each piece on each square gets a random * 64-bit number, and the hash is the XOR of all piece positions plus state. */ import { Piece, SquareIndex, InternalBoard } from '../types'; /** * Initialize Zobrist hash tables with random 64-bit numbers * * This should be called once at startup. Uses a simple PRNG seeded * with a fixed value for deterministic hashing. */ export declare function initZobrist(): void; /** * Compute the Zobrist hash for a board position * * @param board - Board to hash * @returns 64-bit Zobrist hash */ export declare function computeZobristHash(board: InternalBoard): bigint; /** * Update hash after moving a piece * * This is more efficient than recomputing the entire hash. * * @param hash - Current hash * @param piece - Piece being moved * @param from - Source square * @param to - Destination square * @returns Updated hash */ export declare function updateHashMove(hash: bigint, piece: Piece, from: SquareIndex, to: SquareIndex): bigint; /** * Update hash after capturing a piece * * @param hash - Current hash * @param capturedPiece - Piece being captured * @param square - Square where capture occurred * @returns Updated hash */ export declare function updateHashCapture(hash: bigint, capturedPiece: Piece, square: SquareIndex): bigint; /** * Toggle side to move in hash * * @param hash - Current hash * @returns Updated hash with toggled side */ export declare function toggleSide(hash: bigint): bigint; /** * Update hash for castling rights change * * @param hash - Current hash * @param whiteShortOld - Old white short castling right * @param whiteShortNew - New white short castling right * @param whiteLongOld - Old white long castling right * @param whiteLongNew - New white long castling right * @param blackShortOld - Old black short castling right * @param blackShortNew - New black short castling right * @param blackLongOld - Old black long castling right * @param blackLongNew - New black long castling right * @returns Updated hash */ export declare function updateHashCastling(hash: bigint, whiteShortOld: boolean, whiteShortNew: boolean, whiteLongOld: boolean, whiteLongNew: boolean, blackShortOld: boolean, blackShortNew: boolean, blackLongOld: boolean, blackLongNew: boolean): bigint; /** * Update hash for en passant square change * * @param hash - Current hash * @param oldSquare - Old en passant square (or null) * @param newSquare - New en passant square (or null) * @returns Updated hash */ export declare function updateHashEnPassant(hash: bigint, oldSquare: SquareIndex | null, newSquare: SquareIndex | null): bigint; /** * Add a piece to the hash * * @param hash - Current hash * @param piece - Piece to add * @param square - Square where piece is added * @returns Updated hash */ export declare function addPieceToHash(hash: bigint, piece: Piece, square: SquareIndex): bigint; /** * Remove a piece from the hash * * @param hash - Current hash * @param piece - Piece to remove * @param square - Square where piece is removed * @returns Updated hash */ export declare function removePieceFromHash(hash: bigint, piece: Piece, square: SquareIndex): bigint; //# sourceMappingURL=zobrist.d.ts.map