Module shakmaty::zobrist

source ·
Expand description

Zobrist hashing for positions.

§Stability

The Zobrist hash for each position is guaranteed to be stable. Changing hash values is considered a semver breaking change and will be noted in the changelog.

§Warning: Forged collisions

Zobrist hashes have excellent collision resistance, but can be forged efficiently.

§Examples

use shakmaty::{Chess, EnPassantMode, zobrist::{Zobrist64, ZobristHash}};

let pos = Chess::default();
assert_eq!(pos.zobrist_hash::<Zobrist64>(EnPassantMode::Legal), Zobrist64(0x463b96181691fc9c));

Structs§

Traits§