def zobrist_hash(board: chess.Board, *, _hasher: Callable[[chess.Board], int] = ZobristHasher(POLYGLOT_RANDOM_ARRAY)) -> int:
    """
    Calculates the Polyglot Zobrist hash of the position.

    A Zobrist hash is an XOR of pseudo-random values picked from
    an array. Which values are picked is decided by features of the
    position, such as piece positions, castling rights and en passant
    squares.
    """
    return _hasher(board)