Implement core logic for Zobrist hashing